1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-12-01 14:51:52 +00:00
C02/py65/conds.c02

58 lines
2.6 KiB
Plaintext
Raw Normal View History

/****************************************
* CONDS - Test Conditional Expressions *
****************************************/
#include <py65.h02>
#include <stdio.h02>
#include <stdlib.h02>
char passed = " Passed. ";
char failed = " Failed. ";
main:
puts("1==1 "); if (1==1) puts(&passed); else puts(&failed);
puts("1==2 "); if (1==2) puts(&failed); else puts(&passed);
puts("1+1=2"); if (1+1 == 2) puts(&passed); else puts(&failed);
puts("1<>2 "); if (1<>2) puts(&passed); else puts(&failed);
puts("1<>1 "); if (1<>1) putln(&failed); else putln(&passed);
puts("1<2 "); if (1<2) puts(&passed); else puts(&failed);
puts("2<1 "); if (2<1) puts(&failed); else puts(&passed);
puts("1<1 "); if (1<1) putln(&failed); else putln(&passed);
puts("1<=2 "); if (1<=2) puts(&passed); else puts(&failed);
puts("2<=1 "); if (2<=1) puts(&failed); else puts(&passed);
puts("1<=1 "); if (1<=1) putln(&passed); else putln(&failed);
puts("2>1 "); if (2>1) puts(&passed); else puts(&failed);
puts("1>2 "); if (1>2) puts(&failed); else puts(&passed);
puts("1>1 "); if (1>1) putln(&failed); else putln(&passed);
puts("2>=1 "); if (2>=1) puts(&passed); else puts(&failed);
puts("1>=2 "); if (1>=2) puts(&failed); else puts(&passed);
puts("1>=1 "); if (1>=1) putln(&passed); else putln(&failed);
puts("$FF "); if ($FF) puts(&passed); else puts(&failed);
puts("$00 "); if ($00) puts(&failed); else puts(&passed);
puts("1|0 "); if (1|0) puts(&passed); else puts(&failed);
puts("1&0 "); if (1&0) puts(&failed); else puts(&passed);
puts("1^1 "); if (1^1) putln(&failed); else putln(&passed);
puts("!$FF "); if (!$FF) puts(&failed); else puts(&passed);
puts("!$00 "); if (!$00) puts(&passed); else puts(&failed);
2018-02-14 00:52:14 +00:00
puts("!1|0 "); if (!1|0) puts(&failed); else puts(&passed);
puts("!1&0 "); if (!1&0) puts(&passed); else puts(&failed);
puts("!1^1 "); if (!1^1) putln(&passed); else putln(&failed);
puts("$FF:+"); if ($FF:+) puts(&failed); else puts(&passed);
puts("$FF:-"); if ($FF:-) puts(&passed); else puts(&failed);
puts("$00:+"); if ($00:+) puts(&passed); else puts(&failed);
puts("$00:-"); if ($00:-) puts(&failed); else puts(&passed);
puts("!0:+ "); if (!0:+) putln(&failed); else putln(&passed);
puts("atoc(\"0\")"); if (atoc("0")) puts(&failed); else puts(&passed);
puts("atoc(\"1\")"); if (atoc("1")) puts(&passed); else puts(&failed);
puts("atoc(\"128\"):-"); if (atoc("128"):-) putln(&passed); else putln(&failed);
goto exit;