Interrogation
1990/12/01 Arrojeria, Eustakio - Elhuyar Zientziaren Komunikazioa | Lizaso, Pili - Informatika SailaElhuyar Fundazioa Iturria: Elhuyar aldizkaria
Following the custom of each year, we have prepared a game program in holiday season. In number 5, we published the LABYRINTH program.
In that program the boy had to find a way to reach a specific goal, avoiding the obstacles he had on the way.
On this occasion, however, you will have to do it yourself, starting with the picture in the right corner of the labyrinth and moving the square tiles until you reach the first left box at the top.
In this case you will not have obstacles, that is, you can locate the tab in any of the boxes. Yes, in order to stay, you will have to answer a question about the color of the picture. Of course, if you do not respond correctly to the question you will return to the previous position.
The topics chosen are: Geography, Sport and Culture. Each theme has one color and each table box will have one of these colors. Therefore, even if there are no physical barriers, not mastering a topic well can be a problem when moving forward.
On the other hand, the random colors that are distributed in the table makes it impossible to completely avoid a theme. See where you lead your steps. start
Description of the program
- 10-130: The labyrinth
consists of three colored paintings. Each table is randomly assigned a color and each color has a theme. - 140-240: The explanation of the keys that can be used to move the tab and the topics that will be discussed will be on the screen.
- 250-1020: The main cycle of the
program.The tab (8,8) will be initially in the box and will end when the box (1,1) is reached. - 260-530: Control of movement keys. The new position of the tab will be calculated according to the key that has been pressed.
- 540-560: Moves the tab to the new selected position.
- 570-660: The color of the current box will indicate the data file from which the question should be taken. One of the 25 questions in each file will be randomly selected.
- 670-770: Presentation of the question.
- 780-880: Control of the
choice of response. There are three possible answers that can be selected using the ~ key and cyclically. - 890-lO: Verification of
the answer. If the answer has been correct, the tile will be in place. If it has not been correct it will return to where it was.
OBSERVATIONS:
- So far we included the data in the
program itself, in the DATE judgments. Now, however,
the data acquire a higher volume and, on the other hand, it is interesting to keep the ohida program and the data in different files.These data files
can be created with the same editor that writes the program. Two issues to consider: a) The names given to these data files must match those listed in the program on lines 590-600-610. b) The number of questions containing the data files will be
indicated
on line 620. Therefore, if the number of questions is not 25, this data should be modified in the program. - These data files are sequential, that is, to be able to read a specific data must pass all the previous ones.
- As READ is used to read data from DATA statements, what should be used is INPUT to make readings from a sequential file.
The new judgments we have used in this program are:
- OPEN "file name" FOR INPUT AS #z This sentence opens the file for reading and, incidentally, it is assigned a z number as identification, being able to exist several files opened simultaneously.
- INPUT #z,<ald>,[<ald>]... <ald> <ald> <ald> This <ald> <ald> <ald> sentence reads the data in a file numbered as z and
is assigned to the indicated variables. - CLOSE #z This sentence closes the file with the number z.
Gai honi buruzko eduki gehiago
Elhuyarrek garatutako teknologia