OSDN Git Service

svn rev.329より移動。
[chnosproject/CHNOSProject.git] / CHNOSProject / chnos / tolset_chn_000 / chnos_008 / stars / stars.c
diff --git a/CHNOSProject/chnos/tolset_chn_000/chnos_008/stars/stars.c b/CHNOSProject/chnos/tolset_chn_000/chnos_008/stars/stars.c
new file mode 100644 (file)
index 0000000..6a3e988
--- /dev/null
@@ -0,0 +1,24 @@
+#include <apilib.h>\r
+\r
+void CHNMain(void)\r
+{\r
+       uchar *buf;\r
+       uint winID;\r
+       int i, x, y;\r
+\r
+       api_initmalloc();\r
+       buf = api_malloc(150*100);\r
+       winID = api_openwin(buf, 150, 100, -1, "stars");\r
+       api_boxfilwin(winID + 1, 6, 26, 143, 93, black);\r
+       for(i = 0; i < 50; i++){\r
+               x = (rand() % 137) + 6;\r
+               y = (rand() % 67) + 26;\r
+               api_point(winID + 1, x, y, yellow);\r
+       }\r
+       api_refreshwin(winID, 6, 26, 144, 94);\r
+       for(;;){\r
+               if(api_getkey(true) == 0x0a) break;\r
+       }\r
+       api_end();\r
+}\r
+\r