1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-08 06:29:32 +00:00

Added py65 program to test select/case/default

This commit is contained in:
Curtis F Kaylor 2018-02-06 21:33:27 -05:00
parent 998b2e11e6
commit 9c49c61d44

41
py65/testslct.c02 Normal file
View File

@ -0,0 +1,41 @@
/************************************************
* TESTSELECT - Test C02 Select/Case Statements *
************************************************/
#include <py65.h02>
#include <stdio.h02>
char c;
main:
for (c=0; c<=9; c++) {
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();
for (c=0; c<=9; c++) {
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("*");
}
}
goto exit;