Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2012 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4215681 to your computer and use it in GitHub Desktop.
Save anonymous/4215681 to your computer and use it in GitHub Desktop.
class Oyuncular
attr_accessor :name,:score
end
evet = 1
hayır = 2
print "Oyuncu 1 ismin ne?"
oyuncu1=Oyuncular.new
oyuncu1.name=gets.chomp
print "Oyuncu 2 ismin ne?"
oyuncu2=Oyuncular.new
oyuncu2.name=gets.chomp
rastgelesayı1=rand 1..20
rastgelesayı2=rand 1..20
print oyuncu1.name
puts oyuncu1.score=rastgelesayı1
print oyuncu2.name
puts oyuncu2.score=rastgelesayı2
# while (oyuncu1.score >= 21) || (oyuncu2.score >= 21)
if oyuncu1.score < oyuncu2.score
puts " #{oyuncu1.name} başka kart istermisin?"
else oyuncu1.score > oyuncu2.score
puts "#{oyuncu2.name} başka kart istermisin?"
end
#end
#if gets == 1
oyuncu1.score + rastgelesayı1
print oyuncu1.score
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment