Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
29
Task/100-doors/XBasic/100-doors.basic
Normal file
29
Task/100-doors/XBasic/100-doors.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
PROGRAM "100doors"
|
||||
VERSION "0.0001"
|
||||
|
||||
IMPORT "xma"
|
||||
IMPORT "xst"
|
||||
|
||||
DECLARE FUNCTION Entry()
|
||||
|
||||
FUNCTION Entry()
|
||||
maxpuertas = 100
|
||||
cont = 0
|
||||
DIM puertas[100]
|
||||
|
||||
FOR p = 1 TO maxpuertas
|
||||
IF INT(SQRT(p)) = SQRT(p) THEN puertas[p] = 1
|
||||
NEXT p
|
||||
|
||||
PRINT "The doors are open: ";
|
||||
FOR p = 1 TO maxpuertas
|
||||
IF puertas[p] = 1 THEN
|
||||
PRINT p; " ";
|
||||
INC cont
|
||||
END IF
|
||||
NEXT p
|
||||
|
||||
PRINT CHR$(10); "Are "; STR$(cont); " open doors."
|
||||
|
||||
END FUNCTION
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue