All pastes #197014 Raw Edit

alligator.rb

public ruby v1 · immutable
·published 2006-10-11 00:56 UTC
rendered paste body
Pieces = ['rock', 'paper', 'scissors']def play	a,b = rand(3),rand(3)	case ((b-a).abs)		when 0;	puts "The Lianator got a tie with #{Pieces[b]}, but will win next time for sure"		else; case (b-a)			when 1,-2; puts "The Lianator won with #{Pieces[b]} against #{Pieces[a]}"			when -1,2; puts "The Lianator lost with #{Pieces[b]} against #{Pieces[a]}, but will win next time"		end	endend(puts 'alligator.rb (--help | number of iterations)'; exit) if '--help' == ARGV[0] or nil == ARGV[0](ARGV[0] ||= 1).to_i.times do play end