Hmm... looks like my version of ruby is an unstable fucker. time to dl an older version.
Name:
Anonymous2006-10-11 14:19
I know shit all about ruby, but shouldn't you add 1 before converting the number to a string?
Name:
Anonymous2006-10-11 14:25
Hmm.
Yes, you're correct. BRAINFARTS FOR THE WIN!
New version:
puts 'lolhi. pick a number'
fav =gets.to_i
puts fav.to_s + '?'
fav2=fav+1
pits fav2.to_s ' is a prime number, faggot.'
Still doesn't fucking work. Stupid unstable shit version.
Name:
Anonymous2006-10-12 1:45
[b]puts[/b] fav2.to_s ' is a prime number, faggot.'Doesn't ruby give an error for this kind of stuff?
Name:
Anonymous2006-10-12 2:05
puts is one of the print methods, so no. You can use print, p, and puts, which stands for put string IIRC... and that's all I can think of off the top of my head.
Name:
Anonymous2006-10-12 3:38
Made the fucker work and realised I hadn't posted it here.
puts 'lolhi. pick a number'
fav = gets.to_i
puts (fav.to_s) + '?'
fav2 = fav+1
pits fav2.to_s ' is a prime number, faggot.'
I have no idea why chucking parenthesis around the first to_s made the prog run, but wtf ever works.
Name:
Anonymous2006-10-12 16:31
>>8
That's what happens when language syntax sucks, e.g. Perl, Ruby
Name:
Anonymous2009-01-14 14:20
VALID PERL CODE
Name:
Trollbot90002009-07-01 8:49
Typeerror from sandbox rb 7 Someone please tel me why this is a superiorated version of this post on my desk by this time tomorrow?
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy