Tell the black box what you want it to do. (See "instructions" below.) When you are done with your instructions, click on "Construct". A new page will open with the black box. Enter any numbers that need to be entered, then click on "Engage".

The Black Box Game

One person makes a black box. The second person tries to guess what is in it.

The second person wins if he/she guesses what is in the black box. This means that the second player can predict what will come out of the black box. The first player wins if the second player has fun. The first person should try to make the problem challenging but possible.

A Sample Program

This program adds two numbers:
m = read
n = read
y = m + n
print y

Instructions

Sometimes the format of an instruction has to be exactly right.
  • The command a = 7 + 3 means this. Find the mailbox labelled a, or make a new mailbox and label it a. Calculate the value of 7 + 3 and put it in this mailbox. If you follow this command with b = a + 6, the black box will make a mailbox, label it b, and put the value of 16 in the b mailbox.
  • The command n = read (or n = readanumber) will make make a mailbox labelled n and put into it the number coming into the box.
  • When you print something, that comes out of the box. The command print "hi" prints the word hi. print a prints the value found in the mailbox labeled a.
  • 3 * 4 and 3 x 4 multiply 3 and 4. 3/4 divides 3 by 4.

Advanced Instructions

If you number a line, you can use a "go to" statement to send the machine to that line. For example:
1. m = read
2. n = read
3. y = m + n
4. print y
5. go to #4

The last command will cause the maching to print y again and again.

You do not have to number lines except if you are going to use a "go to" to that line.

You can also use "if" commands. For example print y if y < 10 or go to #4 if y < 10.

Extra Commands

web pages

BACK