It's kind of difficult to write a program without a computer, but it's a good try. A few remarks:
- All command lines should be closed with semicolon.
- The variables should have a type. x, y, A, B should be defined as type int.
- The equality test is DOUBLE equal sign: if (A == x && B == y) ... (&& is "and"). If you use single equal, then A will be made equal to x and B will be made equal to y and the equation will always be true.
- Instead of the four dbLine commands you could use one dbBox, it's shorter: dbBox(left, top, right, bottom)
- The command for random coordinates is dbRND, not dbRandom. Also if you want to make it really random, you should use dbRandomize(dbTimer()) once at the beginning of the program to seed the random number generator.
- For user input, the simplest is probably dbInput("enter a number", A) and the same for B.
- Since you didn't write this with a computer, the program structure is missing. The Dark GDK game template will create a framework for you when you make a new project. It already contains a game loop:
while ( LoopGDK () )
{
// update the screen
dbSync ( );
}
When the user guesses right, you can use a "break" command to get out of the loop and finish the program.