home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
SHUFFLE.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
63 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME SHUFFLE .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7, 0
CLS
? "┌────────────────────────────────────────────────────────────
? "│ ShuffleB ( Arr? (), First%, Last%, Load% )
? "│ ShuffleI ( Arr% (), First%, Last%, Load% )
? "│ ShuffleW ( Arr??(), First%, Last%, Load% )
? "├────────────────────────────────────────────────────────────────
? "│ These 3 iterations on a theme provide some excitement and mystery
? "│ to your programs.
? "│ If Load% is TRUE then the incoming array will have it's elements
? "│ loaded with consecutive numbers from First% to Last%
? "└─────────────────────────────────────────────────────────────────────────
RANDOMIZE TIMER
DIM P%(4), A$(4)
Q$ = "What is the capital of Illinois?"
A$(1) = "Lincoln"
A$(2) = "Chicago"
A$(3) = "Springfield"
A$(4) = "Peoria"
ShuffleI P%(), 1, 4, -1
PRINT
PRINT Q$
PRINT " (1) "; A$( P%(1) )
PRINT " (2) "; A$( P%(2) )
PRINT " (3) "; A$( P%(3) )
PRINT " (4) "; A$( P%(4) )
PRINT
PRINT "Your answer, please: ";
DO
ClearKeyboard
WHILE NOT INSTAT : WEND
G$ = INKEY$
LOOP UNTIL ( G$ => "1" ) AND ( G$ =< "4" )
PRINT G$
A? = VAL( G$ )
IF P%( A? ) = 3 THEN PRINT "CORRECT!" ELSE PRINT "WRONG"