2009 T

Size: px
Start display at page:

Download "2009 T"

Transcription

1 T Wii Visual C Express Edition Visual C Express Edition Paint.net ++ 1

2 2009 T

3 Visual C Express Edition

4 1 2 Visual C Express Edition Visual C Express Edition Visual C Express Edition DirectX Windows DirectX Windows 2.1 Visual C Express Edition Visual C Express Edition Visual C Express Edition Microsoft Visual Studio Express Edition Visual C Web ( ) Visual C Express Edition 2.2 Visual C Express Edition 4

5 2.3 Visual C Express Edition 1 Win32 Win32 2 C++ cpp 3 C/C++ (/MTd) 4 Debug Release (/MT) 1: 2: Win32 3: 4: Release 5

6 3 if for C #include DxLib.h #include <math.h> int WINAPI WinMain(){ #include DxLib.h C #include<stdio.h> DX int WINAPI WinMain() int main(void) #include <math.h> C 1sin cos ChangeWindowMode(); () TRUE () FALSE ChangeWindowMode(); 3.1 char Key[256]; GetHitKeyStateAll(Key); 6

7 Z Z Z Z if(key[ KEY INPUT Z]==1) 3.2 GetColor(255,255,255) GetColor(255,255,255) GetColor(255,0,0) GetColor(0,0,128) GetColor(255,255,0) GetColor(0,0,0) DX printf( ); (1)DrawString(100, 100,,GetColor(255,255,255)); (2)DrawFormatString(100,150,GetColor(255,0,0), Sum=% d,sum); (0,0) (640,480) (1) x,y GetColor(255,255,255) (100,100) (2) % d (1) (100,150) Sum 7

8 int Moji; Moji=CreateFontToHandle( HGS, 48, 1, DX FONTTYPE NORMAL); // (1) DrawStringToHandle(100,100,,GetColor(255, 255, 255),Moji); // (2A) DrawFormatStringToHandle(100,150,GetColor(255, 0, 0),Moji, % d,sum); // (2B) int (1) (1) HGS, HGS Moji (2A) (2B), HGS 3.4 int Picture1; Picture1=LoadGraph( Pic1.png ); // (1) DrawGraph(100, 100, Pic1, FALSE); // (2) int Picture1 (1) Pic1.png (2) (100,100) Pic1.png 5 5 int Picture2[100]; LoadDivGraph( Pic2.png, 16, 4, 4, 20, 20, Picture2); // (3) DrawGraph(100, 200, Picture2[0], FALSE); // (4) 5 Picture2[100] (3) Pic2.png Picture2[100] (2) Picture2 Pic2.png (4) (100,200) Pic2.png 8

9 double PI=3.14; DrawRotaGraph(100, 300, 2.0f, PI/2,Picture2[0],TRUE ); (100,300) 5 /2 2.0f double PI 5: Pic2.png 9

10 4 6 Game Start SPACE RETURN 6: 4.1 while 6 void GameStart(void) { while(1){ GetHitKeyStateAll( Key ) ; if( ProcessMessage() == -1 ) break ; 10

11 DrawGraph(0, 0, Open, FALSE); DrawStringToHandle( 100, 80,, GetColor(255, 255, 0), FontHG48); DrawBox(195, *start select, 510, *start select, GetColor(255, 255, 0), FALSE); DrawStringToHandle( 250, 250, PUSH RETURN, GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 252, teki0[0], TRUE); DrawFormatStringToHandle(250, 275, GetColor(255, 255, 255), FontHGS24, Time : %d,time1); DrawGraph(200, 277, Apple[0], TRUE); DrawStringToHandle( 250, 300, :, GetColor(255, 255, 255), FontHGS24); DrawFormatStringToHandle(360, 300,Lv color, FontHGS24, %s,lv1); DrawGraph(200, 302, Apple[13], TRUE); while(1){ break; break RETURN if( ProcessMessage() == -1 ) break; break; while(1) DrawBox(195, *start select, 510, *start select, GetColor(255, 255, 0), FALSE); GetColor(255, 255, 0) 195, *start select 510, *start select start select y Time 11

12 4.2 if(start counter<10) start counter++; else if(key[ KEY INPUT DOWN ] == 1 ){ start counter=0; start select++; if(start select>3) start select=1; else if(key[ KEY INPUT UP ] == 1 ){ start counter=0; start select ; if(start select<1) start select=3; start counter++; start select -1 start select Time if(time counter<10) time counter++; else if(start select==1 && Key[ KEY INPUT RIGHT ] == 1 ){ time counter=0; time select++; 12

13 if(time select>7) time select=7; else if(start select==1 && Key[ KEY INPUT LEFT ] == 1 ){ time counter=0; time select ; if(time select<1) time select=1; if(time select==0) time1=10; else if(time select==1) time1=30; else if(time select==7) time1=600; time select if(lv counter 10) Lv counter++; if(lv==1){ strcpy(lv1, Very Easy ); Lv color=getcolor(0, 255, 255); if(lv==2){ strcpy(lv1, Easy ); Lv color=getcolor(0, 255, 0); 13

14 Lv essy hard strcpy(lv1, very easy ); Lv1 very easy easy Lv color Lv 2 easy : // int Maxhp0[10]= {3, 2, 5, 2, ; int attack0[10]={3, 1, 5, 2, ; int speed0[10]= {3, 3, 1, 5, ; int count0[10]= {2, 5, 1, 3, ; int 7 void GameStart(void) 14

15 else if(start select==3){ DrawStringToHandle(110, 375,, GetColor(0, 200, 255), FontHGS20); DrawStringToHandle(110, 400,, GetColor(255, 0, 50), FontHGS20); DrawStringToHandle(110, 425,, GetColor(255, 255, 0), FontHGS20); DrawStringToHandle(110, 450,, GetColor(0, 255, 0), FontHGS20); for(i=0; i Maxhp0[character]; i++) DrawStringToHandle(200+20*i, 375,, GetColor(0, 200, 255), FontHGS20); for(j=0; j attack0[character]; j++) DrawStringToHandle(200+20*j, 400,, GetColor(255, 0, 50), FontHGS20); for(k=0; k speed0[character]; k++) DrawStringToHandle(200+20*k, 425,, GetColor(255, 255, 0), FontHGS20); for(m=0; m count0[character]; m++) DrawStringToHandle(200+20*m, 450,, GetColor(0, 255, 0), FontHGS20); DrawStringToHandle for int int character 15

16 5 void tama Input(void) { if(tama counter<5) // (1) tama counter++; else if(waza select==0 && Key[ KEY INPUT SPACE ] == 1 ){ // (2) tama counter=0; shot=tamamax; for(j=0; j<shot; j++){ if(tama[j].flag==0){ tama[j].flag=1; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=1; break; else if(waza select==1 && Key[ KEY INPUT SPACE ] == 1 ){ // (3) tama counter=5; shot=tamamax; tama Draw(); void tama Draw(void) { for(j=0; j<shot; j++){ if(tama[j].flag==1){ tama[j].y-=7; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); tama Hantei(); 16

17 void tama Input(void) (1) if if int tama counter (2) else if Waza select==0 SPACE (3) tama counter=5 (2) tama Draw(void) SPACE Waza select SPACE Waza select==0 Waza select==2 Waza select==3 tama Draw(void) DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); cut[0] 1.5f cut[0] 1.5 tama[j].x tama[j].y x y tama[j].y-=7 7 tama Hantei(); 17

18 6 8 8: DX 9: 18

19 DrawStringToHandle( 505, 68, HP, GetColor( 255, 255, 0 ), FontHGS20) ; DrawFormatStringToHandle( 545, 80, GetColor( 255, 255, 255 ), FontHG20, % d, hp); DrawFormatStringToHandle( 575, 80, GetColor( 255, 255, 255 ), FontHG20, /% d, Maxhp) ; DrawBox(525, 70, 635, 80, GetColor(0, 0, 0), TRUE); if(hp<20) DrawBox(525, 70, *hp/Maxhp, 80, GetColor(255, 0, 0), TRUE ); else if(hp<50) DrawBox(525, 70, *hp/Maxhp, 80, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 70, *hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); 9 HG int FontHG20 DrawStringToHandle DrawFormatStringToHandle DrawBox GetColor() TRUE DrawBox(525, 70, *hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); (525,70) ( *hp/Maxhp,80) *hp/Maxhp hp Maxhp hp 9 if DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); FALSE GetColor() 19

20 DrawBox(502, (Waza x+20)+waza select*20, 635, (Waza x+40)+waza select*20, GetColor(255, 255, 0), FALSE); if(waza counter<10) Waza counter++; else if(key[ KEY INPUT Z ] == 1 ){ Waza counter=0; Waza select++; if(waza select>3) Waza select=0; else if(key[ KEY INPUT X ] == 1 ){ Waza select=0; DrawStringToHandle(535, 370,, GetColor(255, 255, 0), FontHG20) ; DrawGraph(505,390, Waza1[0], TRUE); for(a=1; a<wazax; a++){ DrawGraph(505,390+20*a, Waza1[a], TRUE); DrawBox(530, *a, 630, *a, GetColor(0, 0, 0), TRUE); DrawBox(530, *a, *Waza[a]/MaxWaza[a], *a, GetColor(255, 0, 255), TRUE ); DrawBox(530, *a, 630, *a, GetColor(255, 255, 255), FALSE); 10: 8 Z,X Z 20

21 C for for for for 7 21

22 8 [1] [2] [3] Microsoft Visual Studio 2008 Express Edition [4] [5] qma/education/cpro/index.html 22

23 9 #include "DxLib.h" #include <math.h> #define tamamax 500 #define StarMAX 30 #define SparkMAX 800 #define tekimax 100 #define WazaX 4 #define charax 9 #define PI // char Key[256]; struct shot{ double x, y, x2, y2; double angle, X, Y, Z; int color; int flag; int Size; int attack; int A,d; ; struct STAR{ int x, y; int flag; int apple; int hantei_x, hantei_y, range; int color; int Size; int hp, Maxhp; int mp1, mp2; int attack; int counter; int shot; int teki; ; struct TEKI{ double x, y; int i; 23

24 int flag; int Size; int attack; double angle; int counter, shot; int color; int hantei_x, hantei_y, range; ; struct SPARK{ int x, y, xflag; int flag; int Sx, Sy; int color; int i, star; int time; ; void StartData(void); void GameStart(void); void GameOver(void); void Fighter(void); void Star_Draw(void); void Star_Hantei(void); void teki_attack(void); void teki_draw(void); void teki_hantei(void); void CreateSpark(int m, int n); void MoveSpark(void); void tama_input(void); void tama_draw(void); void tama_hantei(void); void GameDate(void); struct shot tama[tamamax]; struct STAR Star[StarMAX]; struct TEKI teki[tekimax]; struct SPARK Spark[SparkMAX]; int tama_counter=50, Star_counter=20; int a, i, j, k, m, n; int x, y; int P, Q; 24

25 int shot, teki_shot; int hp, Maxhp; int attack, speed, count; int score=0, score1, hscore=0; int tekihp=1, tekimaxhp=1, tekihpflag=0; int food_count=0; double hantei_x, hantei_y, range1; double hantei_x, hantei_y, range2; int Haikei_X=-960; int teki_count=0; int RefreshTime; // int Maxhp0[10]= {3, 3, 5, 2, 3, 2, 5, 4, 3; int attack0[10]={3, 1, 5, 1, 3, 4, 3, 2, 4; int speed0[10]= {3, 3, 1, 5, 4, 2, 2, 4, 2; int count0[10]= {3, 5, 1, 4, 2, 4, 2, 2, 3; int start_select=0, start_counter=0; int time, time1, time_select=2, time_counter=0; int Lv=3, Lv_select=2, Lv_counter=0, LvA=0, LvC=0, LvHP=0, LvS=0, Lv_color; int character=0, character_counter=0; char Lv1[10]; int end_select=0, end_counter=0; int Waza[WazaX], MaxWaza[WazaX]; int Waza_select=0, Waza_counter=0, Waza_x=370; int Haikei, Open, Data, end; int MAN[32]; int cut[10]; int Apple[32], Mp[5]; int teki0[10], teki1[10], teki2, teki3, teki4, teki5; int tekia; int Waza0, Waza1[10]; int Bom,Block,Allow; int FontHGS_Spark, FontHGS16, FontHGS20, FontHGS24, FontHG16, FontHG20, FontHG24, FontHG48; // WinMain int WINAPI WinMain( HINSTANCE hinstance, HINSTANCE hprevinstance,lpstr lpcmdline, int ncmdshow ){ ChangeWindowMode( TRUE ); // 25

26 if( DxLib_Init() == -1 ) return -1; //DX SetMainWindowText( " " ) ; FontHGS_Spark=CreateFontToHandle("HGS ", 10, 1, DX_FONTTYPE_NORMAL); FontHGS20=CreateFontToHandle("HGS ", 16, 16, DX_FONTTYPE_NORMAL); FontHGS24=CreateFontToHandle("HGS ", 24, 6, DX_FONTTYPE_NORMAL); FontHG16=CreateFontToHandle("HG ", 16, 1, DX_FONTTYPE_NORMAL); FontHG20=CreateFontToHandle("HG ", 20, 1, DX_FONTTYPE_NORMAL); FontHG24=CreateFontToHandle("HG ", 24, 1, DX_FONTTYPE_NORMAL); FontHG48=CreateFontToHandle("HG ", 48, 1, DX_FONTTYPE_NORMAL); Open=LoadGraph("PicFile\\Open.png"); end=loadgraph("picfile\\end.png"); LoadDivGraph("PicFile\\man.png", 18, 2, 9, 16, 16, MAN); Haikei=LoadGraph("PicFile\\haikei.png"); Data=LoadGraph("PicFile\\data.png"); LoadDivGraph("PicFile\\Apple.png", 16, 4, 4, 20, 20, Apple); LoadDivGraph("PicFile\\mp.png", 4, 2, 2, 20, 20, Mp); LoadDivGraph("PicFile\\teki0.png", 6, 3, 2, 20, 17, teki0); LoadDivGraph("PicFile\\teki1.png", 2, 2, 1, 16, 16, teki1); teki2=loadgraph("picfile\\teki2.png"); teki3=loadgraph("picfile\\teki3.png"); teki4=loadgraph("picfile\\teki4.png"); teki5=loadgraph("picfile\\teki5.png"); Bom=LoadGraph("PicFile\\Bom.png"); Block=LoadGraph("PicFile\\Block.png"); Allow=LoadGraph("PicFile\\Allow.png"); LoadDivGraph("PicFile\\Waza.png", 4, 2, 2, 20, 20, Waza1); LoadDivGraph("PicFile\\cut.png", 2, 2, 1, 9, 9, cut); SetDrawScreen( DX_SCREEN_BACK ) ;// GameStart(); StartData(); while(1){ RefreshTime = GetNowCount(); ClearDrawScreen(); GetHitKeyStateAll( Key ) ; // // // 26

27 if( ProcessMessage() == -1 ) break ; // DrawGraph(500, 0, Data, FALSE); DrawGraph(0, Haikei_X, Haikei, FALSE); Haikei_X+=1; if(haikei_x>0) Haikei_X=-960; Fighter(); // MoveSpark(); Star_Draw(); // tama_input(); // GameDate(); //ESC if( Key[ KEY_INPUT_ESCAPE] == 1 ) { hp=0; GameOver(); ScreenFlip() ;// while(getnowcount() - RefreshTime < 11); DxLib_End() ;// return 0 ;// // WinMain void StartData(void) { hp=maxhp; if(score1>hscore) hscore=score1; score=0; time=time1*60+60; // tekihp=1; tekimaxhp=1; tekihpflag=0; 27

28 food_count=0; teki_count=0; x=250; y=420; if(lv==4){ LvHP=1; LvA=1; if(lv==5){ LvHP=2; LvA=3; LvS=2; if(lv==6){; LvC=1; LvS=10; Maxhp=Maxhp0[character]*20+40; hp=maxhp; attack=attack0[character]; speed=speed0[character]+1; count=count0[character]-1; Haikei_X=-960; Waza_select=0; Waza_counter=0; for(i=1; i<wazax; i++){ MaxWaza[i]=1000; Waza[i]=MaxWaza[i]*0.3; for(i=0; i<tamamax; i++){ tama[i].y=450; tama[i].flag=0; for(i=0; i<tekimax; i++){ teki[i].flag=0; teki[i].y=0; 28

29 teki[i].counter=0; for(i=0; i<starmax; i++){ Star[i].flag=0; Star[i].y=0; for(i=0; i<sparkmax; i++){ Spark[i].flag=0; Spark[i].xflag=0; // void GameStart(void) { while(1){ GetHitKeyStateAll( Key ) ; // if( ProcessMessage() == -1 ) break ; // DrawGraph(0, 0, Open, FALSE); DrawStringToHandle( 100, 80, " ", GetColor(255, 255, 0), FontHG48); DrawBox(195, *start_select, 490, *start_select, GetColor(255, 255, 0), FALSE); DrawStringToHandle( 250, 250, "Game Start", GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 252, teki0[0], TRUE); DrawFormatStringToHandle(250, 275, GetColor(255, 255, 255), FontHGS24, "Time : %d",time1); DrawGraph(200, 277, Apple[0], TRUE); DrawStringToHandle( 250, 300, " : ", GetColor(255, 255, 255), FontHGS24); DrawFormatStringToHandle(360, 300,Lv_color, FontHG24, "%s ",Lv1); DrawGraph(200, 302, Apple[13], TRUE); DrawStringToHandle( 250, 325, " ", GetColor(255, 255, 255), FontHGS24); DrawGraph(200, 327, teki4, TRUE); DrawGraph(430, 327, MAN[character*2], TRUE); if(start_counter<10) start_counter++; else if(key[ KEY_INPUT_DOWN ] == 1 ){ start_counter=0; 29

30 start_select++; if(start_select>3) start_select=3; else if(key[ KEY_INPUT_UP ] == 1 ){ start_counter=0; start_select--; if(start_select<0) start_select=0; if(time_counter<10) time_counter++; else if(start_select==1 && Key[ KEY_INPUT_RIGHT ] == 1 ){ time_counter=0; time_select++; if(time_select>7) time_select=7; else if(start_select==1 && Key[ KEY_INPUT_LEFT ] == 1 ){ time_counter=0; time_select--; if(time_select<1) time_select=1; if(time_select==0) time1=10; else if(time_select==1) time1=30; else if(time_select==2) time1=60; else if(time_select==3) time1=90; else if(time_select==4) time1=120; else if(time_select==5) time1=180; else if(time_select==6) time1=300; else if(time_select==7) time1=600; 30

31 if(lv_counter<10) Lv_counter++; else if(start_select==2 && Key[ KEY_INPUT_RIGHT ] == 1 ){ Lv_counter=0; Lv++; if(lv>6) Lv=6; else if(start_select==2 && Key[ KEY_INPUT_LEFT ] == 1 ){ Lv_counter=0; Lv--; if(lv<1) Lv=1; if(lv==1){ strcpy(lv1,"very Easy"); Lv_color=GetColor(0, 255, 255); if(lv==2){ strcpy(lv1,"easy"); Lv_color=GetColor(0, 255, 0); if(lv==3){ strcpy(lv1,"normal"); Lv_color=GetColor(255, 255, 0); if(lv==4){ strcpy(lv1,"hard"); Lv_color=GetColor(255, 128, 0); if(lv==5){ strcpy(lv1,"very Hard"); Lv_color=GetColor(255, 0, 0); if(lv==6){ strcpy(lv1,"high Speed"); Lv_color=GetColor(255, 100, 255); if(character_counter<10) character_counter++; else if(start_select==3 && Key[ KEY_INPUT_RIGHT ] == 1 ){ character_counter=0; 31

32 character++; if(character>charax-1) character=charax-1; else if(start_select==3 && Key[ KEY_INPUT_LEFT ] == 1 ){ character_counter=0; character--; if(character<0) character=0; DrawBox(105, 370, 535, 470, GetColor(0, 255, 0), FALSE); if(start_select==0) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==1) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==1) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==2) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==3) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==4) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==5) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==2 && Lv==6) DrawStringToHandle(110, 375, " ", GetColor(255, 255, 255), FontHGS20); else if(start_select==3){ DrawStringToHandle(110, 375, " ", GetColor(0, 200, 255), FontHGS20); DrawStringToHandle(110, 400, " ", GetColor(255, 0, 50), FontHGS20); DrawStringToHandle(110, 425, " ", GetColor(255, 255, 0), FontHGS20); DrawStringToHandle(110, 450, " ", GetColor(0, 255, 0), FontHGS20); for(i=0; i<maxhp0[character]; i++) DrawStringToHandle(200+20*i, 375, " ", GetColor(0, 200, 255), FontHGS20); for(j=0; j<attack0[character]; j++) DrawStringToHandle(200+20*j, 400, " ", GetColor(255, 0, 50), FontHGS20); for(k=0; k<speed0[character]; k++) DrawStringToHandle(200+20*k, 425, " ", GetColor(255, 255, 0), FontHGS20); for(m=0; m<count0[character]; m++) 32

33 DrawStringToHandle(200+20*m, 450, " ", GetColor(0, 255, 0), FontHGS20); ScreenFlip(); if(key[ KEY_INPUT_RETURN] == 1 (start_select==0 && Key[ KEY_INPUT_SPACE] == 1 )) break; // void GameOver(void) { int Gyou=150; while(1){ GetHitKeyStateAll( Key ) ; // if( ProcessMessage() == -1 ) break ; // DrawGraph(500, 0, Data, FALSE); DrawGraph(0, Haikei_X, Haikei, FALSE); if(hp<1) DrawStringToHandle( 80, 100, " ", GetColor(255, 0, 0), FontHG48); DrawFormatStringToHandle(100, Gyou, GetColor(0, 255, 255), FontHG24, "Score %d", score); DrawFormatStringToHandle(100, Gyou+25, GetColor(255, 50, 255), FontHG24, " %d", Lv*time1*5 + food_count*100); DrawFormatStringToHandle(120, Gyou+45, GetColor(255, 255, 255), FontHG20, " %d %d = %d", Lv, time1*5, Lv*time1*5) ; DrawFormatStringToHandle(120, Gyou+65, GetColor(255,255, 255), FontHG20, " %d 100 = %d", food_count, food_count*100); score1= score + Lv*time1*5 + food_count*100; DrawLine(100, Gyou+85, 400, Gyou+85, GetColor(255,255,255), FALSE); DrawFormatStringToHandle(100, Gyou+85, GetColor(255,255,0), FontHG24, " %d", score1); 33

34 DrawStringToHandle( 100, 300, " ", GetColor(255, 255, 255), FontHG24); DrawStringToHandle( 120, 325, " Yes", GetColor(255, 255, 255), FontHG24); DrawStringToHandle( 220, 325, " No", GetColor(255, 255, 255), FontHG24); DrawBox( *end_select, 325, *end_select, 350, GetColor(255, 255, 0), FALSE); if(end_counter<10) end_counter++; else if(key[ KEY_INPUT_RIGHT ] == 1 ){ end_counter=0; end_select++; if(end_select>1) end_select=0; else if(key[ KEY_INPUT_LEFT ] == 1 ){ end_counter=0; end_select--; if(end_select<0) end_select=1; if(end_select==0 && Key[ KEY_INPUT_RETURN ] == 1 ){ StartData(); break; else if(end_select==1 && Key[ KEY_INPUT_RETURN ] == 1 ){ DxLib_End(); // exit( -1 ); // ScreenFlip(); // void Fighter(void) { // DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2], TRUE); // if( Key[ KEY_INPUT_RIGHT ] == 1 ) x+=speed; if(x>=468) x=468; if( Key[ KEY_INPUT_LEFT ] == 1 ) 34

35 x-=speed; if(x<=0) x=0; if( Key[ KEY_INPUT_DOWN ] == 1 ) y+=speed; if(y>448) y=448; if( Key[ KEY_INPUT_UP ] == 1 ) y-=speed; if(y<150) y=150; // void Star_Draw(void) { if(star_counter<30-25*lvc) Star_counter++; else{ Star_counter=0; for(i=0; i<starmax; i++){ if(star[i].flag==0){ Star[i].x=10*GetRand(47)+10; P=GetRand(1000); // if(p<100){ if(lv==1) Star[i].flag=0; else Star[i].flag=2; Star[i].hp=15; Star[i].Maxhp=Star[i].hp; else if(p<150){ if(lv==1 Lv==6) Star[i].flag=0; else Star[i].flag=3; Star[i].hp=5; Star[i].Maxhp=Star[i].hp; 35

36 // else if(p<200){ if(lv<3 Lv>5) Star[i].flag=0; else Star[i].flag=GetRand(5)+4; if(teki_count<1) teki_count++; else Star[i].flag=0; Star[i].x=30*(GetRand(8)+1); // if(star[i].flag==4) Star[i].hp=50+LvHP*5; else if(star[i].flag==5) Star[i].hp=60+LvHP*5; else if(star[i].flag==6) Star[i].hp=40+LvHP*5; else if(star[i].flag==7) Star[i].hp=55+LvHP*5; else if(star[i].flag==8) Star[i].hp=42+LvHP*5; else if(star[i].flag==9) Star[i].hp=50+LvHP*5; Star[i].Maxhp=Star[i].hp; // else if(p<350){ Star[i].flag=10; Star[i].apple=GetRand(15); else if(p<450){ Star[i].flag=11; Star[i].mp1=GetRand(29); if(star[i].mp1==0) Star[i].mp2=2; else if(star[i].mp1<5) Star[i].mp2=3; else if(star[i].mp1<15) Star[i].mp2=1; 36

37 else Star[i].mp2=0; else{ Star[i].flag=1; if(lv==6) Star[i].hp=2; else Star[i].hp=10; Star[i].Maxhp=Star[i].hp; Star[i].color=GetRand(5); break; for(i=0; i<starmax; i++){ // if(star[i].flag==1){ Star[i].Size=10; Star[i].y+=1+LvS; DrawGraph(Star[i].x, Star[i].y, teki0[star[i].color], TRUE); Star_Hantei(); else if(star[i].flag==2){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Bom, TRUE); Star_Hantei(); else if(star[i].flag==3){ Star[i].y+=5+LvS; Star[i].Size=5; DrawGraph(Star[i].x, Star[i].y, Allow, TRUE); Star_Hantei(); else if(star[i].flag==4){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; 37

38 else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki1[0], TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==5){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki1[1], TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==6){ if(star[i].y>50 && Star[i].hp>0) Star[i].y=50; else Star[i].y+=2; Star[i].Size=20; Star[i].x=x; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki2, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==7){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki3, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==8){ if(star[i].y>30 && Star[i].hp>0) Star[i].y=30; else Star[i].y+=1; 38

39 Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki4, TRUE); Star_Hantei(); teki_attack(); else if(star[i].flag==9){ if(star[i].y>100 && Star[i].hp>0) Star[i].y=100; else Star[i].y+=1; Star[i].Size=20; DrawRotaGraph(Star[i].x+20, Star[i].y+20, 2.0f, 0, teki5, TRUE); Star_Hantei(); teki_attack(); // else if(star[i].flag==10){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Apple[Star[i].apple], TRUE); Star_Hantei(); else if(star[i].flag==11){ Star[i].y+=1+LvS; Star[i].Size=10; DrawGraph(Star[i].x, Star[i].y, Mp[Star[i].mp2], TRUE); Star_Hantei(); // void Star_Hantei(void) { if(star[i].y>480){ Star[i].x=10*GetRand(47)+10; Star[i].y=0; Star[i].flag=0; // 39

40 hantei_x=(x+8)-star[i].x; hantei_y=(y+8)-star[i].y; range1=16+star[i].size; if( hantei_x * hantei_x + hantei_y * hantei_y < range1 * range1){ if(star[i].flag==1){ hp-=10; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); else if(star[i].flag==2){ hp-=20; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); for(int k=0; k<10; k++){ CreateSpark(x+16, y+16); else if(star[i].flag==3){ hp-=10; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); else if(star[i].flag==10){ if(star[i].apple>9) hp+=10; else hp+=5; food_count++; else if(star[i].flag==11){ if(star[i].mp2==3){ for(a=1; a<wazax; a++) Waza[a]-=MaxWaza[a]*0.2; else if(star[i].mp2==2){ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.3; else if(star[i].mp2==1){ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.1; else{ for(a=1; a<wazax; a++) Waza[a]+=MaxWaza[a]*0.05; 40

41 Star[i].y=490; Star[i].flag=0; if(hp>=maxhp) hp=maxhp; if(hp<=0){ hp=0; GameOver(); for(a=1; a<wazax; a++){ if(waza[a]>=maxwaza[a]) Waza[a]=MaxWaza[a]; if(waza[a]<1) Waza[a]=0; // void teki_attack(void) { if(teki[i].counter<30) teki[i].counter++; else if(star[i].flag==4){ teki[i].counter=10; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=1; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=4; teki[teki[i].i].attack=3+lva; teki[teki[i].i].angle=pi/3+(pi*getrand(30)/90); break; 41

42 else if(star[i].flag==5){ teki[i].counter=20; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=2; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=3; teki[teki[i].i].attack=2+lva*2; teki[teki[i].i].angle=pi/4+(pi*getrand(30)/90); break; else if(star[i].flag==6){ teki[i].counter=0; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=3; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=3; teki[teki[i].i].attack=3+lva; break; else if(star[i].flag==7){ teki[i].counter=25; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=4; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=4; teki[teki[i].i].attack=3+lva; teki[teki[i].i].color=255; teki[teki[i].i].angle=m*pi/6; m++; 42

43 break; else if(star[i].flag==8){ teki[i].counter=25+lva; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=5; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=2; teki[teki[i].i].attack=1; teki[teki[i].i].color=255; teki[teki[i].i].angle=pi/6+(pi*getrand(120)/180); break; else if(star[i].flag==9){ teki[i].counter=25+lva; teki[i].shot=tekimax; for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ if(teki[teki[i].i].flag==0){ teki[teki[i].i].flag=6; teki[teki[i].i].x=star[i].x+20; teki[teki[i].i].y=star[i].y+20; teki[teki[i].i].size=2; teki[teki[i].i].attack=1; teki[teki[i].i].angle=pi/3+(pi*getrand(30)/90); break; teki_draw(); // void teki_draw(void) { for(teki[i].i=0; teki[i].i<teki[i].shot; teki[i].i++){ 43

44 if(teki[teki[i].i].flag==1){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*4; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*4; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,50,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==2){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*6; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*6; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(128,0,255),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==3){ teki[teki[i].i].y+=5; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(255,255,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==4){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*2; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*2; teki[teki[i].i].color-=3; if(teki[teki[i].i].color<0) teki[teki[i].i].color=0; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(255,teki[teki[i].i].color,0),TRUE ); teki_hantei(); else if(teki[teki[i].i].flag==5){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*2; teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*2; teki[teki[i].i].color--; if(teki[teki[i].i].color<0) teki[teki[i].i].color=0; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,teki[teki[i].i].color,255),TRUE ); teki_hantei(); if(teki[teki[i].i].flag==6){ teki[teki[i].i].x+=cos(teki[teki[i].i].angle)*7; 44

45 teki[teki[i].i].y+=sin(teki[teki[i].i].angle)*7; DrawCircle( teki[teki[i].i].x, teki[teki[i].i].y, teki[teki[i].i].size, GetColor(0,0,0), TRUE ); teki_hantei(); // void teki_hantei(void) { if(teki[teki[i].i].x<0 teki[teki[i].i].x>490 teki[teki[i].i].y<0 teki[teki[i].i].y>500 Star[i].hp<1){ teki[teki[i].i].y=500; teki[teki[i].i].flag=0; teki[teki[i].i].hantei_x=(x+16)-teki[teki[i].i].x; teki[teki[i].i].hantei_y=(y+16)-teki[teki[i].i].y; teki[teki[i].i].range=16+teki[teki[i].i].size; if(teki[teki[i].i].hantei_x * teki[teki[i].i].hantei_x + teki[teki[i].i].hantei_y * teki[teki[i].i].hantei_y <= teki[teki[i].i].range * teki[teki[i].i].range){ hp-=teki[teki[i].i].attack; DrawRotaGraph(x+16, y+16, 2.0f, 0, MAN[character*2+1], TRUE); teki[teki[i].i].y=500; teki[teki[i].i].flag=0; if(hp<=0){ hp=0; GameOver(); // void tama_input(void) { if(tama_counter<25) tama_counter++; else if(waza_select==0 && Key[ KEY_INPUT_SPACE ] == 1 ){ 45

46 tama_counter=count*5; shot=tamamax; for(j=0; j<shot; j++){ if(tama[j].flag==0){ tama[j].flag=1; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=attack; break; else if(waza_select==1 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=count*5; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<20){ break; else if(tama[j].flag==0){ tama[j].flag=2; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=3; tama[j].attack=attack*2; Waza[Waza_select]-=20; break; else if(waza_select==2 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=25; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<2){ break; else if(tama[j].flag==0){ 46

47 tama[j].flag=3; tama[j].x=x+16; tama[j].y=y; tama[j].y2=y; tama[j].size=5; tama[j].attack=1; tama[j].color=255; tama[j].angle=-(5*pi/12+(pi*getrand(30)/180)); tama[j].d=getrand(150)+50; Waza[Waza_select]-=2; break; else if(waza_select==3 && Key[ KEY_INPUT_SPACE ] == 1 ){ tama_counter=25; shot=tamamax; for(j=0; j<shot; j++){ if(waza[waza_select]<2){ break; else if(tama[j].flag==0){ tama[j].flag=4; tama[j].x=x+16; tama[j].x2=x+16; tama[j].y=y+16; tama[j].y2=y+16; tama[j].size=2; tama[j].attack=5; tama[j].color=255; tama[j].angle=-n*pi/4; Waza[Waza_select]-=2; n++; break; tama_draw(); 47

48 // void tama_draw(void) { for(j=0; j<shot; j++){ if(tama[j].flag==1){ tama[j].y-=6; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[0], TRUE); tama_hantei(); else if(tama[j].flag==2){ tama[j].y-=12; DrawRotaGraph(tama[j].x, tama[j].y, 1.5f, 0, cut[1], TRUE); tama_hantei(); else if(tama[j].flag==3){ tama[j].x+=cos(tama[j].angle)*3; tama[j].y+=sin(tama[j].angle)*3; tama[j].color-=12; if(tama[j].color<0) tama[j].color=0; DrawCircle( tama[j].x, tama[j].y, tama[j].size, GetColor(255,tama[j].color,0),TRUE ); tama_hantei(); else if(tama[j].flag==4){ tama[j].x+=cos(tama[j].angle)*3; tama[j].y+=sin(tama[j].angle)*3; tama[j].color-=5; if(tama[j].color<0) tama[j].color=0; DrawCircle( tama[j].x, tama[j].y, tama[j].size, GetColor(0,tama[j].color,255),TRUE ); tama_hantei(); // void tama_hantei(void) { for(i=0; i<starmax; i++){ Star[i].hantei_x=tama[j].x - (Star[i].x+Star[i].Size); Star[i].hantei_y=tama[j].y - (Star[i].y+Star[i].Size); Star[i].range=Star[i].Size + tama[j].size; 48

49 // if( (Star[i].hantei_x * Star[i].hantei_x + Star[i].hantei_y * Star[i].hantei_y <= Star[i].range * Star[i].range) && Star[i].flag<10){ Star[i].hp-=tama[j].attack; tekimaxhp=star[i].maxhp; tekihp=star[i].hp; tekihpflag=1; if(tekimaxhp<1) tekimaxhp=1; if(tekihp<0) tekihp=0; if(star[i].hp<=0){ if(star[i].flag==1){ score+=50; Spark[j].star=3; if(star[i].flag==2){ score+=100; Spark[j].star=5; if(star[i].flag==3){ score+=100; Spark[j].star=3; if(star[i].flag>3){ score+=300; teki_count--; Spark[j].star=5; for(spark[j].i=0; Spark[j].i<Spark[j].star; Spark[j].i++){ CreateSpark(tama[j].x, tama[j].y); tama[j].y=y; tama[j].flag=0; Star[i].y=490; 49

50 else{ tama[j].y=y; tama[j].flag=0; if( (tama[j].flag==1 && tama[j].y<tama[j].y2-150) (tama[j].flag==2 && tama[j].y<0) (tama[j].flag==3 && tama[j].y<tama[j].y2-tama[j].d) (tama[j].flag==4 && (tama[j].x<tama[j].x2-100 tama[j].x>tama[j].x2+100 tama[j].y<tama[j].y2-100 tama[j].y>tama[j].y2+100)) tama[j].x>500-tama[i].size){ tama[j].y=y; tama[j].flag=0; // void GameDate(void) { DrawLine(500,0,500,480,GetColor(255,255,255),FALSE); // time--; DrawFormatStringToHandle(510, 0, GetColor(255,255,255 ), FontHG20, "time %d", time/60); if(time/60<=0) GameOver(); // DrawFormatStringToHandle(510,30, GetColor(255,255,255 ), FontHG20, "Score %d", score); // DrawStringToHandle( 505, 68, "HP", GetColor( 255, 255, 0 ), FontHGS20) ; DrawFormatStringToHandle( 545, 80, GetColor( 255, 255, 255 ), FontHG20, "%d", hp); DrawFormatStringToHandle( 575, 80, GetColor( 255, 255, 255 ), FontHG20, "/%d", Maxhp) ; DrawBox(525, 70, 635, 80, GetColor(0, 0, 0), TRUE); if(hp<0.2*maxhp) DrawBox(525, 70, *hp/Maxhp, 80, GetColor(255, 0, 0), TRUE ); else if(hp<0.5*maxhp) 50

51 DrawBox(525, 70, *hp/Maxhp, 80, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 70, *hp/Maxhp, 80, GetColor(0, 225, 0), TRUE ); DrawBox(525, 70, 635, 80, GetColor(255, 255, 255), FALSE); // DrawGraph(502,105, teki0[0], TRUE); if(tekihpflag==1){ DrawFormatStringToHandle( 555, 120, GetColor( 255, 255, 255 ), FontHG20, "%d", tekihp); DrawFormatStringToHandle( 575, 120, GetColor( 255, 255, 255 ), FontHG20, "/%d", tekimaxhp); DrawBox(525, 110, 635, 120, GetColor(0, 0, 0), TRUE); if(tekihp<=tekimaxhp*0.2) DrawBox(525, 110, *tekiHP/tekiMAXHP, 120, GetColor(255, 0, 0), TRUE ); else if(tekihp<=tekimaxhp*0.5) DrawBox(525, 110, *tekiHP/tekiMAXHP, 120, GetColor(255, 255, 0), TRUE ); else DrawBox(525, 110, *tekiHP/tekiMAXHP, 120, GetColor(0, 128, 255), TRUE ); DrawBox(525, 110, 635, 120, GetColor(255, 255, 255), FALSE); DrawLine(500, 160, 640, 160, GetColor(255,255,255), FALSE); DrawStringToHandle( 525, 160, " ", GetColor( 255, 255, 0), FontHG20); DrawStringToHandle( 505, 185, " : ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 205, " :SPACE ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 225, " :Z,C ", GetColor( 255, 255, 255), FontHG16); DrawStringToHandle( 505, 245, " :Esc ", GetColor( 255, 255, 255), FontHG16); DrawLine(500, 275, 640, 275, GetColor(255,255,255), FALSE); DrawStringToHandle( 525, 275, " ", GetColor( 255, 255, 0 ), FontHG20) ; DrawFormatStringToHandle( 510, 300, GetColor( 255, 255, 255 ), FontHG16, " %d", time1); DrawStringToHandle( 510, 320, "Lv", GetColor( 255, 255, 255), FontHG16) ; DrawFormatStringToHandle( 535, 320, Lv_color, FontHG16, "%s", Lv1); DrawFormatStringToHandle( 510, 340, GetColor( 255, 255, 255 ), FontHG16, "HighScore %d", hscore); DrawLine(500, Waza_x, 640, Waza_x, GetColor(255,255,255), FALSE); DrawBox(502, (Waza_x+20)+Waza_select*20, 635, (Waza_x+40)+Waza_select*20, GetColor(255, 255, 0) FALSE); if(waza_counter<10) Waza_counter++; 51

52 else if(key[ KEY_INPUT_Z ] == 1 ){ Waza_counter=0; Waza_select++; if(waza_select>3) Waza_select=0; else if(key[ KEY_INPUT_X ] == 1 ){ Waza_select=0; DrawStringToHandle( 535, Waza_x, " ", GetColor( 255, 255, 0 ), FontHG20) ; DrawGraph(505,Waza_x+20, Waza1[0], TRUE); for(a=1; a<wazax; a++){ DrawGraph(505,(Waza_x+20)+20*a, Waza1[a], TRUE); DrawBox(530, (Waza_x+25)+20*a, 630, (Waza_x+35)+20*a, GetColor(0, 0, 0), TRUE); DrawBox(530, (Waza_x+25)+20*a, *Waza[a]/MaxWaza[a], (Waza_x+35)+20*a, GetColor(255, 0, 255), TRUE ); DrawBox(530, (Waza_x+25)+20*a, 630, (Waza_x+35)+20*a, GetColor(255, 255, 255), FALSE); // void CreateSpark(int m, int n) { for(k=0; k<sparkmax; k++){ if(spark[k].flag==0) break; if(k!= SparkMAX){ Spark[k].x=m*100; Spark[k].y=n*100; Spark[k].Sx=GetRand(600)-300; Spark[k].Sy=-GetRand(200); Spark[k].time=GetRand(150)+50; Spark[k].color=GetRand(4); if(spark[k].color==0) Spark[k].color=GetColor(255,255,0); else if(spark[k].color==1) Spark[k].color=GetColor(0,255,255); else if(spark[k].color==2) 52

53 Spark[k].color=GetColor(255,100,255); else if(spark[k].color==3) Spark[k].color=GetColor(255,150,0); else if(spark[k].color==4) Spark[k].color=GetColor(0,255,0); Spark[k].flag=1; // void MoveSpark(void) { for(k=0; k<sparkmax; k++){ if(spark[k].flag==0) continue; Spark[k].y+=Spark[k].Sy; if(spark[k].xflag==0) Spark[k].x+=Spark[k].Sx; else if(spark[k].xflag==1) Spark[k].x-=Spark[k].Sx; Spark[k].Sy+=3; Spark[k].time--; if(spark[k].time<0){ Spark[k].flag=0; Spark[k].xflag=0; if(spark[k].x<0 Spark[k].x/100>490) Spark[k].xflag=1; for(k=0; k<sparkmax; k++){ if(spark[k].flag==1){ DrawStringToHandle(Spark[k].x/100, Spark[k].y/100, " ", Spark[k].color, FontHGS_Spark); 53

ソフトゼミ B 第 1 回 VisualC++ DX ライブラリの導入 はじめにゼミ B では ゼミ A で学んだ C 言語の基礎を土台に Microsoft Visual C Express Edition( 以下 VisualC++, VC++) の使い方と DX ライブラリ とい

ソフトゼミ B 第 1 回 VisualC++ DX ライブラリの導入 はじめにゼミ B では ゼミ A で学んだ C 言語の基礎を土台に Microsoft Visual C Express Edition( 以下 VisualC++, VC++) の使い方と DX ライブラリ とい ソフトゼミ B 第 1 回 VisualC++ DX ライブラリの導入 はじめにゼミ B では ゼミ A で学んだ C 言語の基礎を土台に Microsoft Visual C++ 2010 Express Edition( 以下 VisualC++, VC++) の使い方と DX ライブラリ というゲームの作成を強力にサポートしてくれるプログラム群の使い方を学んでゆきます なお VC++ と DX

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

More information

Java学習教材

Java学習教材 Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("

More information

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h> 2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html [email protected] /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

Windows (L): D:\jyugyou\ D:\jyugyou\ D:\jyugyou\ (N): en2 OK 2

Windows (L): D:\jyugyou\ D:\jyugyou\ D:\jyugyou\ (N): en2 OK 2 Windows C++ Microsoft Visual Studio 2010 C++ Microsoft C++ Microsoft Visual Studio 2010 Microsoft Visual Studio 2010 C++ C C++ Microsoft Visual Studio 2010 Professional Professional 1 Professional Professional

More information

pptx

pptx iphone 2010 8 18 C [email protected] C Hello, World! Hello World hello.c! printf( Hello, World!\n );! os> ls! hello.c! os> cc hello.c o hello! os> ls! hello!!hello.c! os>./hello! Hello, World!! os>! os>

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

main

main 14 1. 12 5 main 1.23 3 1.230000 3 1.860867 1 2. 1988 1925 1911 1867 void JPcalendar(int x) 1987 1 64 1 1 1 while(1) Ctrl C void JPcalendar(int x){ if (x > 1988) printf(" %d %d \n", x, x-1988); else if(x

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç C (3) if else switch AND && OR (NOT)! 1 BMI BMI BMI = 10 4 [kg]) ( [cm]) 2 bmi1.c Input your height[cm]: 173.2 Enter Input your weight[kg]: 60.3 Enter Your BMI is 20.1. 10 4 = 10000.0 1 BMI BMI BMI = 10

More information

課題

課題 int starttime_msec; boolean counting = false; size(400,200); smooth(); //font は各自のものに変更してください font = loadfont("serif-48.vlw"); void mouseclicked(){ counting = true; starttime_msec = millis(); int t=0;

More information

課題

課題 float xball;// 円の中心の X 座標 float yball; // 円の中心の Y 座標 float rball; // 円の半径 color cball; // 円の色 // 円を移動させる void updateball(){ yball -= 1; if(yball+rball< 0){ yball = height+rball; // 円を描く void drawball(){

More information

課題

課題 size(300,120); void drawrect(float x,float y,float w,float h,color c){ rectmode(corner); stroke( (a) ); fill( (b) ); rect( (c), (d), (e), (f) ); float x = map(hour(), (g), (h), (i), (j) ); drawrect(0,0,x,height/3,color(

More information

programmingII2019-v01

programmingII2019-v01 II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2

More information

橡Pro PDF

橡Pro PDF 1 void main( ) char c; /* int c; */ int sum=0; while ((c = getchar())!= EOF) if(isdigit(c) ) sum += (c-'0'); printf("%d\n", sum); main()int i,sum=0; for(i=0;i

More information

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1....................................

1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1.................................... 06H082 1 1 2 2 2.1 Java......... 2 2.2................................. 3 2.3.................................. 3 3 4 3.1..................................... 4 3.2 GP.....................................

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1 6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = t 44.1 khz t = 1 sec 44100 j t f j {f 0, f 1, f 2,, f 1 6.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1, 2,,

More information

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

More information

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 +

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 + 7 7.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave T > 0 t 44.1 khz t = 1 44100 j t f j {f 0, f 1, f 2,, f 1 = T t 7.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1,

More information

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

Excel97関数編

Excel97関数編 Excel97 SUM Microsoft Excel 97... 1... 1... 1... 2... 3... 3... 4... 5... 6... 6... 7 SUM... 8... 11 Microsoft Excel 97 AVERAGE MIN MAX SUM IF 2 RANK TODAY ROUND COUNT INT VLOOKUP 1/15 Excel A B C A B

More information

Microsoft Word - no15.docx

Microsoft Word - no15.docx 7. ファイルいままでは プログラムを実行したとき その結果を画面で確認していました 簡単なものならそれでもいいのですか 複雑な結果は画面で見るだけでなく ファイルに保存できればよいでしょう ここでは このファイルについて説明します 使う関数のプロトタイプは次のとおりです FILE *fopen(const char *filename, const char *mode); ファイルを読み書きできるようにする

More information

tuat1.dvi

tuat1.dvi ( 1 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 6 23 ( 1 ) 1 / 58 C ( 1 ) 2 / 58 2008 9 2002 2005 T E X ptetex3, ptexlive pt E X UTF-8 xdvi-jp 3 ( 1 ) 3 / 58 ( 1 ) 4 / 58 C,... ( 1 ) 5 / 58 6/23( )

More information

devkitpro msys

devkitpro msys 2009 RPG T050017 1 1 2 1 2.1 devkitpro msys....................... 1 2.2................................. 2 2.3......................... 2 2.4........... 2 3 3 3.1........................... 3 3.1.1.............................

More information

1 4 2 EP) (EP) (EP)

1 4 2 EP) (EP) (EP) 2003 2004 2 27 1 1 4 2 EP) 5 3 6 3.1.............................. 6 3.2.............................. 6 3.3 (EP)............... 7 4 8 4.1 (EP).................... 8 4.1.1.................... 18 5 (EP)

More information

8 if switch for while do while 2

8 if switch for while do while 2 (Basic Theory of Information Processing) ( ) if for while break continue 1 8 if switch for while do while 2 8.1 if (p.52) 8.1.1 if 1 if ( ) 2; 3 1 true 2 3 false 2 3 3 8.1.2 if-else (p.54) if ( ) 1; else

More information

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2  2 B R b I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio 17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include typedef struct Potter{ Potter; int main(void){

More information

1.3 ( ) ( ) C

1.3 ( ) ( ) C 1 1.1 (Data Base) (Container) C++ Java 1.2 1 1.3 ( ) ( ) 1. 2. 3. C++ 2 2.1 2.2 2.3 2 C Fortran C++ Java 3 3.1 (Vector) 1. 2. ( ) 3.2 3 3.3 C++ C++ STL C++ (Template) vector vector< > ; int arrayint vector

More information

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル Instruction Manual Disk No. RE01 6th Edition: November 1999 (YK) All Rights Reserved, Copyright 1996 Yokogawa Electric Corporation 801234567 9 ABCDEF 1 2 3 4 1 2 3 4 1 2 3 4 1 2

More information

P06.ppt

P06.ppt p.130 p.198 p.208 2 1 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i < NUM; i++ ) if ( weight[i] > max ) max = weight[i]: if ( weight[i] < min ) min = weight[i]: weight 3 maxof(a,

More information

Microsoft Word - SU1204教本(Driver)原稿.docx

Microsoft Word - SU1204教本(Driver)原稿.docx void setup(){ pinmode(13, OUTPUT); //13 void loop(){ digitalwrite(13, HIGH); //13 HIGH delay(500); digitalwrite(13, LOW); //13 LOW delay(500); setup pinmode loop delay C M B void setup(){ pinmode(12,output);

More information

2017 p vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = 0 (79) J s flux (67) J (79) J( r, t) = k δf δs s( r,

2017 p vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = 0 (79) J s flux (67) J (79) J( r, t) = k δf δs s( r, 27 p. 47 7 7. vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = (79) J s flux (67) J (79) J( r, t) = k δf δs s( r, t) t = k δf δs (59) TDGL (8) (8) k s t = [ T s s 3 + ξ

More information

WinHPC ppt

WinHPC ppt MPI.NET C# 2 2009 1 20 MPI.NET MPI.NET C# MPI.NET C# MPI MPI.NET 1 1 MPI.NET C# Hello World MPI.NET.NET Framework.NET C# API C# Microsoft.NET java.net (Visual Basic.NET Visual C++) C# class Helloworld

More information

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa I 2017 11 1 SageMath SageMath( Sage ) Sage Python Sage Python Sage Maxima Maxima Sage Sage Sage Linux, Mac, Windows *1 2 Sage Sage 4 1. ( sage CUI) 2. Sage ( sage.sage ) 3. Sage ( notebook() ) 4. Sage

More information

新・明解C言語 実践編

新・明解C言語 実践編 第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; 19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

プログラミング基礎

プログラミング基礎 C プログラミング Ⅱ 演習 2-1(a) BMI による判定 文字列, 身長 height(double 型 ), 体重 weight (double 型 ) をメンバとする構造体 Data を定義し, それぞれのメンバの値をキーボードから入力した後, BMI を計算するプログラムを作成しなさい BMI の計算は関数化すること ( ) [ ] [ ] [ ] BMI = 体重 kg 身長 m 身長

More information

r3.dvi

r3.dvi 00 3 2000.6.10 0 Java ( 7 1 7 1 GSSM 1? 1 1.1 4 4a 4b / / 0 255 HTML X 0 255 16 (0,32,255 #0020FF Java xclock -bg #0020FF xclock ^C (Control C xclock 4c 1 import java.applet.applet; import java.awt.*;

More information

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231 0 0.1 ANSI-C 0.2 web http://www1.doshisha.ac.jp/ kibuki/programming/resume p.html 0.3 2012 1 9/28 0 [ 01] 2 10/5 1 C 2 3 10/12 10 1 2 [ 02] 4 10/19 3 5 10/26 3 [ 03] 6 11/2 3 [ 04] 7 11/9 8 11/16 4 9 11/30

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

More information

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >= II 14 2018 7 26 : : [email protected] 14,, 8 2 12:00 1 O(1) n O(n) O(log n) O(1) 32 : 1G int 4 250 M 2.5 int 21 2 0 100 0 100 #include #define HASHSIZE 100 /* */ #define NOTFOUND 0

More information

1-4 int a; std::cin >> a; std::cout << "a = " << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >>

1-4 int a; std::cin >> a; std::cout << a =  << a << std::endl; C++( 1-4 ) stdio.h iostream iostream.h C++ include.h 1-4 scanf() std::cin >> 1 C++ 1.1 C C++ C++ C C C++ 1.1.1 C printf() scanf() C++ C hello world printf() 1-1 #include printf( "hello world\n" ); C++ 1-2 std::cout

More information

Java updated

Java updated Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................

More information

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main =1= (.5, 1.65), (1., 2.72), (2., 7.39).2,.4,.6,.8, 1., 1.2, 1.4, 1.6 1 1: x.2 1.4128.4 1.5372.6 1.796533.8 2.198 1.2 3.384133 1.4 4.1832 1.6 5.1172 8 7 6 5 y 4 3 2 1.5 1 1.5 2 x 1: /* */ #include

More information