mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-22 16:34:15 +00:00
Added py65 program to test select/case/default
This commit is contained in:
parent
998b2e11e6
commit
9c49c61d44
41
py65/testslct.c02
Normal file
41
py65/testslct.c02
Normal 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;
|
Loading…
Reference in New Issue
Block a user