}

Do I have a number, what is it?

1988/08/01 Arrojeria, Eustakio - Elhuyar Zientziaren Komunikazioa | Lizaso, Pili - Informatika SailaElhuyar Fundazioa Iturria: Elhuyar aldizkaria

When presenting this program, we want to offer the opportunity to play and, at the same time, offer a way to work logic and the ability to draw conclusions in a playful environment.

We want to keep playing. It is often said that one of the best ways to learn things and work the ability of the person is the playing environment. When presenting this program, we want to offer the opportunity to play and, at the same time, offer a way to work logic and the ability to draw conclusions in a playful environment.

Game Description

    The game consists of devising a 5-digit number created randomly by the program.
    Every time you enter a number, in addition to matching, you will be provided with the number of digits that are in the right place.
    The random number created by the program will not include repeated digits.
  1. You will have 28 options to match the random number.

For example:

    number created by the program: 43756
    entered by you: 35789
    hits: 3 (3,5,7)
  • in the right place: 1 (7)

If I have a number it is: ***
20 COLOUR 2: CLS: KEY OFF: DIM JOKO(5): DIM DIG(10)
30 LOCATE 2,31:PRINT "Game explanation":LOCATE 3,31:
PRINT "==================="
40 LOCATE 5,9:PRINT "1.- The essence of this game is random computers";
"5 di-":LOCATE 6,13:PRINT "is the invention of a drop number."
50 LOCATE 8,9:PRINT "2.- Invent a number every time you enter it"; "from the to- digit":LOCATE 9,13 :PRINT "pure and guessed plus place e"; "you will
be given the number of those who
are in the cat":LOCATE 10,13:PRINT "you go".
60 LOCATE 12,9:PRINT "3.- In the random number created by the
computer "; "there is no repetitive-":LOCATE 13,13:PRINT "."
70 LOCATE 15,9:PRINT "4.- 28 options you can choose the random number
as"; "layout iza-":LOCATE 16,13:PRINT "te."
80 LOCATE 18,13:PRINT "Example:":LOCATE 18,25:PRINT "on the computer";
"number = ";:COLOR 4:PRINT "43756":COLOR 2:LOCATE 19,25:
PRINT "entered by you = ";:COLOR 4:PRINT "35789"
90 LOCATE 21,25:PRINT "invented = 3 (3,5,7)":LOCATE 22,25: PRINT=
1
(7)" 100 GOSUB 570: REM
CONTINUE 110 CLS: COLOR 2
120
FOR I=1 TO



10: DIG(I)=I-1:
NEXT I: NEX=130 NIC=0; IDEM=

140 ":LOCATE 2,27:

PRINT "===========================":LOCATE 4,13:PRINT "INVENTED WHERE";
"SUITABLE":LOCATE 4,52:PRINT "INVENTED IN THE RIGHT PLACE"
220 LOCATE 5,13: PRINT "--------------------------------------":LOCATE 5,52:
PRINT "------------------------"
230 XX=4: YY=7
240 REM REFRACTIVE
250 REM
260 ASMA=0
EGOKI=0
270
LOCATE
YY,THEN XX:PRINT"-------- 1








Related


information:
LOCATE YY,XX+27:RIGHT PRINT:COLOR 2
400 YY=YY+1
410 IF$

= "E" OR YY=21 THEN
GOTO

440
420

LOCATE 23,15:PRINT SPC(64) 423,30
IF News "; cons-print 3:COLOR You've hit
COLOR 2:PRINT." Responder Eliminar ! ": GOTO 520
510 LOCATE 23,5:PRINT "You're not right. Number ";:COLOR 3:NUMBER PRINT;:
COLOUR 2:PRINT ". I'll be there!"
520 GOSUB 570: Exercising
530 RETURN
540 REM AMAIA *** To continue rem, what is my number?
** 550 REM
560 REM
570 REM
580 COLOR 3: LOCATE 25.30: PRINT "Press J to
continue" 590
TE$=INKEY$
WHILE TE$ "" TE=INKEY: FIND

600$ MONTH

Program structure

    In line 20, the arrays are dimensioned.
    On lines 30-90, where the game is described.
    Line 120, where the digits that make up the numbers are stored. In lines
    130-200, the question is asked, the successes and digits placed in the right place are reported and the number is invented or the possibilities are finished.
  • On lines 570-630, until the user press the "j" key the program stops.

Observations

On this occasion the random number generated by the program must meet two requirements: on the one hand, it must have 5 digits and on the other, all digits must be different.

Elhuyar to meet these conditions. Recent searches In number 14 we use the same system we use to order cyclists (120-200).

Gai honi buruzko eduki gehiago

Elhuyarrek garatutako teknologia