2018-02-07 02:33:27 +00:00
|
|
|
/************************************************
|
|
|
|
* TESTSELECT - Test C02 Select/Case Statements *
|
|
|
|
************************************************/
|
|
|
|
|
|
|
|
#include <py65.h02>
|
|
|
|
#include <stdio.h02>
|
|
|
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
main:
|
|
|
|
|
2018-02-07 03:50:50 +00:00
|
|
|
for (c=0; c<10; c++) {
|
2018-02-07 02:33:27 +00:00
|
|
|
prbyte(c);
|
|
|
|
putc(' ');
|
|
|
|
select (c) {
|
|
|
|
case 0: putln("OH!");
|
|
|
|
case 1: putln("WON");
|
|
|
|
case 7,8,9: putln("SEVEN ATE NINE");
|
|
|
|
case 4: putln("FORE!");
|
|
|
|
case 10: putln("TEN");
|
|
|
|
case 0: putln("OOPS!");
|
|
|
|
default: putln("*");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
newlin();
|
2018-02-07 03:50:50 +00:00
|
|
|
for (c=0; c<10; c++) {
|
2018-02-07 02:33:27 +00:00
|
|
|
prbyte(c);
|
|
|
|
putc(' ');
|
|
|
|
select (c) {
|
|
|
|
case 0,7: putln("SEVEN - LOVE");
|
|
|
|
case 5:
|
|
|
|
five: putln("FIVE");
|
|
|
|
case 9:
|
|
|
|
puts("WORKING NINE TO ");
|
|
|
|
goto five;
|
|
|
|
default: putln("*");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-07 03:50:50 +00:00
|
|
|
newlin();
|
2018-02-07 04:24:55 +00:00
|
|
|
for (c=$18; c<$22; c++) {
|
|
|
|
if (c & 15 > 9) continue; //Skip $1A - $1F
|
2018-02-07 03:50:50 +00:00
|
|
|
prbyte(c);
|
|
|
|
putc(' ');
|
|
|
|
select (c) {
|
|
|
|
case $18: putln("I'M EIGHTEEN!");
|
|
|
|
case $19:
|
|
|
|
putln("BREAK ONE-NINE");
|
|
|
|
if (c==$19) break;
|
|
|
|
putln("OOPS!");
|
2018-02-07 04:24:55 +00:00
|
|
|
case $21: putln("BLACKJACK!");
|
|
|
|
default: putln("*");
|
2018-02-07 03:50:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-07 02:33:27 +00:00
|
|
|
goto exit;
|