Skip to content

Instantly share code, notes, and snippets.

@asflash8
Created June 2, 2012 10:09
Show Gist options
  • Select an option

  • Save asflash8/2857651 to your computer and use it in GitHub Desktop.

Select an option

Save asflash8/2857651 to your computer and use it in GitHub Desktop.
みなとRuby会議01 ソーシャルコーディング あみだくじ
person_num = ARGV.first.to_i
person_names = ('A'..'Z').to_a
height = 10
person_num.times do |p|
print "#{person_names[p]} "
end
puts
height.times do |n|
line_display_num = rand(person_num -1)
person_num.times do |p|
if p == line_display_num
print '|---'
else
print '| '
end
end
puts
end
hit_num = rand(person_num)
person_num.times do |p|
if p == hit_num
print "!!! "
else
print " "
end
end
puts
@asflash8

asflash8 commented Jun 4, 2012

Copy link
Copy Markdown
Author

おおお、うれしい!

横線は行でひとつはたしかに少ないですね…

コードを読んで勉強します!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment