All pastes #364455 Raw Edit

Untitled

public ruby v1 · immutable
#364455 ·published 2007-02-20 04:45 UTC
rendered paste body
#!/usr/bin/ruby #what this is:#a dice roller with dnd 3rd edition sane defaults#this is also a test.#please remain calm.#please see the "copythis" function too.Deroach = 1 #debug mode = 1def helpme()	puts "enter in the style of \" 4d6+2 \" you may use . insead of d"	puts "enter h for this message and ^C to quit"	puts ""	puts "This software is completely free, and is released under the"	puts "creative commons attribution-sharealike 2.5 license. A copy"	puts "of this license can be found at:"	puts "http://creativecommons.org/licenses/by-sa/2.5/"	puts ""	returnenddef mainreactorGO()	numdice, sides, pip = nil	print "> "	input = gets	puts input	if input == "h" #help		helpme()	end		#here there be dragons!	numdice, sides, pip = input.scan(/\d+/)		if Deroach == 1		print "numdice: ", numdice, "\n"		print "sides  : ", sides, "\n"		print "pip    : ", pip, "\n"	end	print ">> "	puts numdice.to_i * rand(sides.to_i) + pip.to_i	end	helpmeStupid = nilwhile Stupid == nilmainreactorGOend