Add 28 day code

This commit is contained in:
Yourtion
2016-05-18 10:25:37 +08:00
parent f025b0083f
commit c65ca780b3
137 changed files with 9146 additions and 0 deletions

1
28_day/walk/!cons_9x.bat Normal file
View File

@@ -0,0 +1 @@
command

1
28_day/walk/!cons_nt.bat Normal file
View File

@@ -0,0 +1 @@
cmd.exe

5
28_day/walk/Makefile Normal file
View File

@@ -0,0 +1,5 @@
APP = walk
STACK = 1k
MALLOC = 48k
include ../app_make.txt

1
28_day/walk/make.bat Normal file
View File

@@ -0,0 +1 @@
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

26
28_day/walk/walk.c Normal file
View File

@@ -0,0 +1,26 @@
#include "apilib.h"
void HariMain(void)
{
char *buf;
int win, i, x, y;
api_initmalloc();
buf = api_malloc(160 * 100);
win = api_openwin(buf, 160, 100, -1, "walk");
api_boxfilwin(win, 4, 24, 155, 95, 0);/*黑色*/
x = 76;
y = 56;
api_putstrwin(win, x, y, 3, 1, "*");/*黄色*/
for (;;) {
i = api_getkey(1);
api_putstrwin(win, x, y, 0 , 1, "*"); /*用黑色擦除*/
if (i == '4' && x > 4) { x -= 8; }
if (i == '6' && x < 148) { x += 8; }
if (i == '8' && y > 24) { y -= 8; }
if (i == '2' && y < 80) { y += 8; }
if (i == 0x0a) { break; } /*按回车键结束*/
api_putstrwin(win, x, y, 3 , 1, "*");/*黄色*/
}
api_closewin(win);
api_end();
}