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

A Simple Number Trick

Started by Axisok, 01 March 2016 - 11:22 PM
Axisok #1
Posted 02 March 2016 - 12:22 AM
This program has been updated to use more numbers if the user wants to, but still could be expanded to even more(does not have a limit, this type of guessing can work from 0 to 2^x - 1, x being anything).
I did not test it completely, but I think it works with any number listed.
Also, more numbers to guess means more lists of numbers, but is the same as before.
(I will not expand it further for now, have some other serious projects)


Firstly sorry for any bad english I have there.

This is my first program published there and is based on a simple trick I did with my friends frequently.
It does not have any advanced interface and can be runned on normal computers.

The program will ask you to think in a number and then will show some lists, with 8 numbers each, you say if your number is there or not and the program says your number after all lists were shown.

I recommend to only use this program with "pastebin run", I see no reason to save it in a computer, its just a fun program, useless.

So to run it, type "pastebin run c2aXa33M" on the terminal and follow the instructions.
If you want to see the code its there
Edited on 02 March 2016 - 01:59 PM
LDDestroier #2
Posted 02 March 2016 - 12:39 PM
It's pretty cool. It's different than most 'guess the number' games, as it give me a list to guess from. What I suggest is increasing the limit (1-15 to 1-100 or something), and work on the menu a bit. You can make read() prompts case-insensitive by comparing string.lower(read()) == "ready"
Axisok #3
Posted 02 March 2016 - 01:12 PM
Thank you :)/>
I will try to update it, did not know about the string api but I will use it