Hi, greetings to all,
I'm new on this forum (basically my first post ever on any professional forum).
Anyway, lets get to it and i'm hoping that someone might be able to help.
This is my 5th week of learning COBOL. I'm using a NetExpress IDE (I know this forum is for mainframe help so not sure if this disqualifies me but we have not yet gotten to "that part" of the course).
Basically i'm writing a game which should:
A) Generate 4 random numbers between 1 and 10 (without duplicates).
B) The user/player should then guess what these numbers are.
C) If the user has all his digits in the correct spots it's a match.(whenever a match is found , the game should display BBBB)
D) If the user guessed the correct digits but not in the correct spot (the game should display them a "C" for "change" in that particular spot)
E) when wrong display an X.
ex. random computer generated num = 4510
user entered num = 7120
computer display = XCXB
The user gets five tries.
Okay that's what is required.
So far im able to generate random numbers , with a different sequence every time the program is run.
I store those numbers in an array. I accept the users numbers I store them in a separate array. and then I have another "display" array that will be giving the clues.
I know I have to use IF's to compare the arrays , but don't really want to "check" these arrays 1 by 1.(it seems so tacky).
So I want to use a mixture of IF's and perform varying loops.
All i'm looking for is some advice on how I can tackle my problem.
TIA.