Posted 23 September 2012 - 03:28 AM
See, if I want to make a program like this:
Enter a number and I will tell you if it's higher than five.
Number:
And I do this code:
Firstly, does an integer have to be converted to go in print?
Ex:
Finally, how do I make sure the program doen't crash if I put a string into "number = read()"
Enter a number and I will tell you if it's higher than five.
Number:
And I do this code:
print ("Enter thy number and I will tell you if it is higher than five")
print ("")
write "Number:"
number = read()
if number > 5 then
print ("Thy number ".. number.." is larger than 5")
else
print ("Thy number ".. number.."is smaller than 5")
end
Firstly, does an integer have to be converted to go in print?
Ex:
number=5
print("Number is ".. number.." Hooray!")
Finally, how do I make sure the program doen't crash if I put a string into "number = read()"