ruby-uebungen/Assignment_020/solution
Thomas Smits 25d5ac7ffd Initial commit 2023-05-23 09:19:31 +02:00
..
readme.md Initial commit 2023-05-23 09:19:31 +02:00

readme.md

Lösung: Arrays





































































































```ruby stapel = []

for farbe in %w{P X H K} for wert in %w{7 8 9 0 B D K A} stapel << (farbe + wert).to_sym end end

Mischen

stapel.shuffle!

Karten abnehmen

neu = stapel[0..4] neu << stapel[-5..-1] stapel -= neu

Karten mischen

neu.shuffle!

Karten wieder auf den Stapel legen

stapel << neu

puts neu puts stapel