diff --git a/28_day/Makefile b/28_day/Makefile index 23e155c..2d22dbf 100644 --- a/28_day/Makefile +++ b/28_day/Makefile @@ -19,7 +19,8 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \ winhelo/winhelo.hrb winhelo2/winhelo2.hrb winhelo3/winhelo3.hrb \ star1/star1.hrb stars/stars.hrb stars2/stars2.hrb \ lines/lines.hrb walk/walk.hrb noodle/noodle.hrb \ - beepdown/beepdown.hrb color/color.hrb color2/color2.hrb + beepdown/beepdown.hrb color/color.hrb color2/color2.hrb \ + sosu/sosu.hrb sosu3/sosu3.hrb $(EDIMG) imgin:../z_tools/fdimg0at.tek \ wbinimg src:haribote/ipl10.bin len:512 from:0 to:0 \ copy from:haribote/haribote.sys to:@: \ @@ -41,6 +42,8 @@ haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \ copy from:beepdown/beepdown.hrb to:@: \ copy from:color/color.hrb to:@: \ copy from:color2/color2.hrb to:@: \ + copy from:sosu/sosu.hrb to:@: \ + copy from:sosu3/sosu3.hrb to:@: \ imgout:haribote.img #命令 @@ -73,6 +76,8 @@ full : $(MAKE) -C beepdown $(MAKE) -C color $(MAKE) -C color2 + $(MAKE) -C sosu + $(MAKE) -C sosu3 $(MAKE) haribote.img run_full : @@ -114,6 +119,8 @@ clean_full : $(MAKE) -C beepdown clean $(MAKE) -C color clean $(MAKE) -C color2 clean + $(MAKE) -C sosu clean + $(MAKE) -C sosu3 clean src_only_full : $(MAKE) -C haribote src_only @@ -134,6 +141,8 @@ src_only_full : $(MAKE) -C beepdown src_only $(MAKE) -C color src_only $(MAKE) -C color2 src_only + $(MAKE) -C sosu src_only + $(MAKE) -C sosu3 src_only -$(DEL) haribote.img refresh : diff --git a/28_day/sosu/!cons_9x.bat b/28_day/sosu/!cons_9x.bat new file mode 100644 index 0000000..e42252a --- /dev/null +++ b/28_day/sosu/!cons_9x.bat @@ -0,0 +1 @@ +command \ No newline at end of file diff --git a/28_day/sosu/!cons_nt.bat b/28_day/sosu/!cons_nt.bat new file mode 100644 index 0000000..6e07473 --- /dev/null +++ b/28_day/sosu/!cons_nt.bat @@ -0,0 +1 @@ +cmd.exe \ No newline at end of file diff --git a/28_day/sosu/Makefile b/28_day/sosu/Makefile new file mode 100644 index 0000000..de7b705 --- /dev/null +++ b/28_day/sosu/Makefile @@ -0,0 +1,5 @@ +APP = sosu +STACK = 2k +MALLOC = 0k + +include ../app_make.txt diff --git a/28_day/sosu/make.bat b/28_day/sosu/make.bat new file mode 100644 index 0000000..6b0dbfc --- /dev/null +++ b/28_day/sosu/make.bat @@ -0,0 +1 @@ +..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/28_day/sosu/sosu.c b/28_day/sosu/sosu.c new file mode 100644 index 0000000..6b9a997 --- /dev/null +++ b/28_day/sosu/sosu.c @@ -0,0 +1,24 @@ +#include +#include "apilib.h" + +#define MAX 1000 + +void HariMain(void) +{ + char flag[MAX], s[8]; + int i, j; + for (i = 0; i < MAX; i++) { + flag[i] = 0; + } + for (i = 2; i < MAX; i++) { + if (flag[i] == 0) { + /*没有标记的为质数*/ + sprintf(s, "%d ", i); + api_putstr0(s); + for (j = i * 2; j < MAX; j += i) { + flag[j] = 1; /*给它的倍数做上标记*/ + } + } + } + api_end(); +} diff --git a/28_day/sosu2/!cons_9x.bat b/28_day/sosu2/!cons_9x.bat new file mode 100644 index 0000000..e42252a --- /dev/null +++ b/28_day/sosu2/!cons_9x.bat @@ -0,0 +1 @@ +command \ No newline at end of file diff --git a/28_day/sosu2/!cons_nt.bat b/28_day/sosu2/!cons_nt.bat new file mode 100644 index 0000000..6e07473 --- /dev/null +++ b/28_day/sosu2/!cons_nt.bat @@ -0,0 +1 @@ +cmd.exe \ No newline at end of file diff --git a/28_day/sosu2/Makefile b/28_day/sosu2/Makefile new file mode 100644 index 0000000..d97a733 --- /dev/null +++ b/28_day/sosu2/Makefile @@ -0,0 +1,5 @@ +APP = sosu2 +STACK = 11k +MALLOC = 0k + +include ../app_make.txt diff --git a/28_day/sosu2/make.bat b/28_day/sosu2/make.bat new file mode 100644 index 0000000..6b0dbfc --- /dev/null +++ b/28_day/sosu2/make.bat @@ -0,0 +1 @@ +..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/28_day/sosu2/sosu2.c b/28_day/sosu2/sosu2.c new file mode 100644 index 0000000..381e436 --- /dev/null +++ b/28_day/sosu2/sosu2.c @@ -0,0 +1,24 @@ +#include +#include "apilib.h" + +#define MAX 10000 + +void HariMain(void) +{ + char flag[MAX], s[8]; + int i, j; + for (i = 0; i < MAX; i++) { + flag[i] = 0; + } + for (i = 2; i < MAX; i++) { + if (flag[i] == 0) { + /*没有标记的为质数*/ + sprintf(s, "%d ", i); + api_putstr0(s); + for (j = i * 2; j < MAX; j += i) { + flag[j] = 1; /*给它的倍数做上标记*/ + } + } + } + api_end(); +} diff --git a/28_day/sosu3/!cons_9x.bat b/28_day/sosu3/!cons_9x.bat new file mode 100644 index 0000000..e42252a --- /dev/null +++ b/28_day/sosu3/!cons_9x.bat @@ -0,0 +1 @@ +command \ No newline at end of file diff --git a/28_day/sosu3/!cons_nt.bat b/28_day/sosu3/!cons_nt.bat new file mode 100644 index 0000000..6e07473 --- /dev/null +++ b/28_day/sosu3/!cons_nt.bat @@ -0,0 +1 @@ +cmd.exe \ No newline at end of file diff --git a/28_day/sosu3/Makefile b/28_day/sosu3/Makefile new file mode 100644 index 0000000..a7e9900 --- /dev/null +++ b/28_day/sosu3/Makefile @@ -0,0 +1,5 @@ +APP = sosu3 +STACK = 1k +MALLOC = 42k + +include ../app_make.txt diff --git a/28_day/sosu3/make.bat b/28_day/sosu3/make.bat new file mode 100644 index 0000000..6b0dbfc --- /dev/null +++ b/28_day/sosu3/make.bat @@ -0,0 +1 @@ +..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/28_day/sosu3/sosu3.c b/28_day/sosu3/sosu3.c new file mode 100644 index 0000000..db4527b --- /dev/null +++ b/28_day/sosu3/sosu3.c @@ -0,0 +1,26 @@ +#include +#include "apilib.h" + +#define MAX 10000 + +void HariMain(void) +{ + char *flag, s[8]; + int i, j; + api_initmalloc(); + flag = api_malloc(MAX); + for (i = 0; i < MAX; i++) { + flag[i] = 0; + } + for (i = 2; i < MAX; i++) { + if (flag[i] == 0) { + /*没有标记的为质数*/ + sprintf(s, "%d ", i); + api_putstr0(s); + for (j = i * 2; j < MAX; j += i) { + flag[j] = 1; /*给它的倍数做上标记*/ + } + } + } + api_end(); +}