This block of code works and it’s easy to see why:-
p "gimme two numbers. first : "
x = gets.chomp
p "second : "
y = gets.chomp
out = x.to_i + y.to_i
This next lot --doesn’t-- and I get the feeling that it has something to
do with scope, maybe within the case block. Am I right?
test_gets_positive p "gimme a number : "
ask = gets.chomp
n = ask.to_i
when n < 0
puts “this number is -ve. i ain’t gonna play no more! STOP!”
when n = 0
print " this number is +ve! this it’s square:"
wtf has happened to n?
+44 7739 171 531