TempleOSTS_131005.ISO
This commit is contained in:
1 parent
1343005a29
commit
2d2a65d572
547 files changed
+33608
-12549
No files matched your search
@@ -5,17 +5,18 @@
|
||||
|
||||
//See $LK,"ST_RAINBOW_10","FF:::/TempleOS/Adam/Gr/GrScreen.CPP,ST_RAINBOW_10"$
|
||||
|
||||
U0 ShowDigit(U8 ch)
|
||||
U0 PrintDigit(U8 ch)
|
||||
{
|
||||
//The %Z code displays a Define subentry
|
||||
"$$FG,%Z$$%d$$FG$$",ch-'0',"ST_RAINBOW_10",ch-'0';
|
||||
if ('0'<=ch<='9')
|
||||
"$$FG,%Z$$%d$$FG$$",ch-'0',"ST_RAINBOW_10",ch-'0';
|
||||
}
|
||||
|
||||
U0 ShowPattern(U8 *st)
|
||||
U0 PrintPattern(U8 *st)
|
||||
{
|
||||
U8 ch;
|
||||
while (ch=*st++)
|
||||
ShowDigit(ch);
|
||||
PrintDigit(ch);
|
||||
NewLine;
|
||||
}
|
||||
|
||||
@@ -33,12 +34,11 @@ U0 Digits()
|
||||
"Try to remember the digits and enter them. "
|
||||
"They are colored based on electrical "
|
||||
"engineering color codes.\n";
|
||||
for (i=0;i<10;i++) {
|
||||
for (i=0;i<10;i++)
|
||||
"$$FG,%Z$$%d: %Z\n",i,"ST_RAINBOW_10",i,i,"ST_RAINBOW_10";
|
||||
}
|
||||
"$$FG$$\n"; //set to default background
|
||||
if (!PressAKey) goto dg_done;
|
||||
|
||||
ch=PressAKey;
|
||||
if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done;
|
||||
while (TRUE) {
|
||||
restart:
|
||||
num=0;
|
||||
@@ -49,25 +49,25 @@ restart:
|
||||
"$$WW,1$$$$BD,DKGRAY$$$$FD,WHITE$$\n";
|
||||
"Pattern\nLength:%d\n\n",num+1;
|
||||
answer[num++]=RandU32%10+'0';
|
||||
ShowPattern(answer);
|
||||
if (!PressAKey) goto dg_done;
|
||||
|
||||
PrintPattern(answer);
|
||||
ch=PressAKey;
|
||||
if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done;
|
||||
DocClear;
|
||||
"$$WW,1$$$$BD,DKGRAY$$$$FD,WHITE$$\n";
|
||||
"Guess\nLength:%d\n\n",num;
|
||||
for (i=0;i<num;i++) {
|
||||
ch=GetChar(,FALSE);
|
||||
if (ch==CH_SHIFT_ESC || ch==CH_ESC)
|
||||
return;
|
||||
ShowDigit(ch);
|
||||
if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done;
|
||||
PrintDigit(ch);
|
||||
if (ch!=answer[i]) {
|
||||
Snd(0);
|
||||
"\nScore:%d\n",num;
|
||||
ShowPattern(answer);
|
||||
Beep;
|
||||
Beep;
|
||||
if (!PressAKey) goto dg_done;
|
||||
goto restart;
|
||||
PrintPattern(answer);
|
||||
Beep; Beep;
|
||||
ch=PressAKey;
|
||||
if (ch==CH_ESC||ch==CH_SHIFT_ESC)
|
||||
goto dg_done;
|
||||
else
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user