Here are the instructions for programming my computer. The default program is GUESS YOU!, instructions below.
Not all its functionality has been black-box tested yet. If there are any bugs, please tell me.
Array reading is a simple extension to the computer. However, I would only think about implementing it if there is any more use to such a function other than array reversing or sorting. If anyone would like to do it himself, go ahead.
Would have loved to implement functions, but would need more space for a 5-bit system in order to do so. (Line numbers are 5-bit, for functions simply need to be able to store are retrieve line numbers in RAM.)
Do note that it takes about 15 seconds per command, and it can take a really long time for complicated programs. The default program needs to process 15 divided by 2, a very CPU-intensive function, thus you will need to wait for some time before it makes its first guess.
Command Format:
[COMMAND - 4 bits][NUM1 - 5 bits][NUM2 - 5 bits]
NUM1/NUM2: If Command is GOTOIF, NUM2 = [Line Number - 5 bits] Default: (Note: still applies if command is ASSIGN) NUM1/NUM2 = [BOOL FromRAM - 1 bit][NUM - 4 bits] If FromRAM is 1 - Read from RAM at address NUM If FromRAM is 0 - Constant NUM
MEMORY: 0000 - 1100: Normal RAM 1101: STDIO 1110: READ ONLY RANDOM 1111: READ ONLY Operation Result (Result of operation commands)
0: RAM 0 = RAN 1: RAM 1 = STDIN 2: RAM 1 < RAM 0 3: IF Operation Result GOTO 8 4: RAM 0 < RAM 1 5: IF Operation Result GOTO 10 6: STDOUT = 15 7: END 8: STDOUT = 0 9: IF TRUE GOTO 1 10: STDOUT = 1 11: IF TRUE GOTO 1
Output Reading: 1 -> Too high, 0 -> Too low, 15 -> Correct
For a more detailed explanation, see next program, where the computer is the player and you are the host. For this program, you are the player and the computer is the host.
GUESS YOU! aka The More Or Less Game, where the player is the computer:
int UpperBound=0,LowerBound=15; while(true){ int Guess=LowerBound+Math.Floor((UpperBound-LowerBound)/2); Console.WriteLine(Guess); int Result=Console.ReadLine(); if(Result==0){ LowerBound=Guess+1; } if(Result==1){ UpperBound=Guess-1; } if(Result==15){ break; } } END;
0: RAM 0 = 0 1: RAM 1 = 15 2: RAM 1 - RAM 0 3: RAM 2 = Operation Result 4: RAM 3 = 0 5: RAM 2 < 2 6: IF Operation Result GOTO 12 7: RAM 3 + 1 8: RAM 3 = Operation Result 9: RAM 2 - 2 10: RAM 2 = Operation Result 12: RAM 3 + RAM 0 13: RAM 4 = Operation Result 14: STDOUT = RAM 4 15: RAM 5 = STDIN 16: RAM 5 == 0 17: IF Operation Result GOTO 21 18: RAM 5 == 1 19: IF Operation Result GOTO 24 20: END 21: RAM 4 + 1 22: RAM 0 = Operation Result 23: IF TRUE GOTO 2 24: RAM 4 - 1 25: RAM 1 = Operation Result 26: IF TRUE GOTO 2
Input: 1 -> Too high, 0 -> Too low, 15 -> Correct
Detailed explanation: 1: Think of a number. 2: Wait for the computer to guess. 3: If the guess is more than your number, click 1. 4: If the guess is less than your number, click 0. 5: If the guess is your number, click 15. 6: Then, wait for the computer to shut itself down if you want to play again.
NOTE: Everything below have not been tested yet, and there may be bugs. For some you will have to convert it into binary yourself. If you do convert it yourself, however, it would be greatly appreciated if you could share it.
0: RAM 0 = STDIN 1: RAM 1 = 0 2: RAM 2 = 2 3: RAM 4 = 2 4: RAM 4 >= RAM 2 5: IF Operation Result GOTO 17 6: RAM 5 = 0 7: RAM 5 >= RAM 2 8: IF Operation Result GOTO 12 9: RAM 5 + RAM 4 10: RAM 5 = Operation Result 11: IF TRUE GOTO 7 12: RAM 5 == RAM 2 13: IF Operation Result GOTO 21 14: RAM 4 + 1 15: RAM 4 = Operation Result 16: IF TRUE GOTO 4 17: RAM 1 + 1 18: RAM 1 = Operation Result 19: RAM 1 == RAM 0 20: IF Operation Result GOTO 24 21: RAM 2 + 1 22: RAM 2 = Operation Result 23: IF TRUE GOTO 3 24: STDOUT = RAM 2 25: END
Any programs you have created yourself for this computer? Share with us!
How to create a program:
1. Know how to program it in a high level language like C++. 2. Write out the assembly code with line numbers (for easy goto reference) in a text file, using only given commands. 3. Write out the binary form of the assembly code. 4. Copy it into the programming palette by sparking the PSCN and NSCN. It is easier to zoom to 4/5 switches at a time, and writing it downwards. That is, write all the commands first, then write all the NUM1s, then all the NUM2s.
A final note to the only type of people who would bother to read all the way down here: if you want to contribute any more functional, faster or smaller components, feel free to. Any style of input can be used, even timed inputs. I value functionality over speed and size, that is, even if it is slower or bigger, I would value it if it has more functionality, but if it is too big I would not be able to fit it in at all. Also, no wifi. It's not that I don't support wifi, it's just that it has limited channels and it gets extremely tedious to heat them at higher channels.
@mark2222(View Post) Great save, but Unspecific Thread Title. I like it... It is very complicated. (your description states that it is a "super" computer... it has not got two CPU's or more.) Now I have something to strive to match, or even make a better one... one day.
@mark2222(View Post) I see. Electronics take a very long time... In fact I am, and have been in the process of making a processor for a while... but exams leave little time to use TPT.