This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DSlink2010's profile picture

Extreme Guess the Number

Started by DSlink2010, 12 May 2013 - 06:11 PM
DSlink2010 #1
Posted 12 May 2013 - 08:11 PM
Welcome to EXTREME Guess the Number!

This guess the number is 111 128 lines of code. I worked more than 30 minutes on it. I hope you like it!
Edit: Welp. I forgot something in V2. Updating… -.-

Installation
[Snip. -L]

Update
Version 2.2: In development
Version 2.1: Edited some code and added a wrong answer system. Its now 128 lines… 17 lines longer… (Broken…)
Version 2: Recoded almost the whole thing! Now its 4 lines shorter and it works great! (Lack of a few features.)
Version 1: The release! 11 Modes. (Fine. But had a error that was gonna be fix in v2)
Edited by
Frederikam #2
Posted 13 May 2013 - 06:13 AM
Try using tonumber()?
DSlink2010 #3
Posted 13 May 2013 - 05:09 PM
Try using tonumber()?
I used that. But I used it the wrong way xD. Working on a fix.
[EDIT] I'm recoding about the whole thing. The modes will be the same so.
LordIkol #4
Posted 14 May 2013 - 06:47 AM
its not tonumber that makes it crash its the fact that u used your own function cprint without the argument for the y
Example line 78 is cPrint("Too high.") but should be sth like cPrint("Too high.",16)

greets
Loki
DSlink2010 #5
Posted 14 May 2013 - 06:05 PM
its not tonumber that makes it crash its the fact that u used your own function cprint without the argument for the y
Example line 78 is cPrint("Too high.") but should be sth like cPrint("Too high.",16)

greets
Loki
Ohhhhh. Well this update will fix that and make the game harder. :3
Edit: Updated.
TheGamerOfAction #6
Posted 16 May 2013 - 11:32 AM
Whenever I tried this it was full of errors. A few errors were caused by using:
print("String" ...variable..."String")
With three dots instead of:

print("String" ..variable.. "String")
With two dots.
You should always remember to test your program before it is released :)/>
LordIkol #7
Posted 17 May 2013 - 03:15 AM
I would be Ashamed to release sth like this buddy.
Its not even Running and has a hell lot of Syntax Errors inside.
DSlink2010 #8
Posted 17 May 2013 - 04:26 PM
Whenever I tried this it was full of errors. A few errors were caused by using:
print("String" ...variable..."String")
With three dots instead of:

print("String" ..variable.. "String")
With two dots.
You should always remember to test your program before it is released :)/>
Thanks. I'm new to the whole releasing program stuff.
jesusthekiller #9
Posted 18 May 2013 - 04:52 AM
Similar thing can be done by this:


print("Guess the number! (1 - 100)")
local num = math.random(1, 100), g
while true do
  local g = tonumber(read())
  if type(g) == "number" then
    if g > num then print("Incorrect! Number is smaller") elseif g < num then print("Incorrect! Number is bigger") elseif g == num then break end
  else
    print("This is not a number!")
  end
end
print("Congratulations!")
Lyqyd #10
Posted 18 May 2013 - 05:23 AM
Code contained malicious payload, to be released under certain circumstances. Locked.