Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish all include the FIGHTERS. #60

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3818c5e
Finish runningLetter
Mar 11, 2017
9ff7682
Finish runningLetter
Mar 11, 2017
fd83f25
Add files via upload
Mar 18, 2017
afe252a
Add files via upload
Mar 18, 2017
1132972
Add files via upload
Mar 18, 2017
a7e717e
Add files via upload
Mar 18, 2017
d4f6449
Add files via upload
Mar 18, 2017
93eac30
Add files via upload
Mar 18, 2017
d95f3d3
Add files via upload
Mar 18, 2017
4d14534
Add files via upload
Mar 28, 2017
bfca93c
Add files via upload
Mar 28, 2017
8de801b
Add files via upload
Mar 28, 2017
884befb
complete c/p12 warehouse
May 23, 2017
09875b6
complete cpp/p01 queue
May 23, 2017
6d47274
rm a.out
May 23, 2017
bc9bcdb
complete cpp/02 stack
May 25, 2017
9231791
Update stack.cpp
May 25, 2017
116d218
complete cpp/p03 safearray
May 25, 2017
231b06b
Update and rename queue.cpp to main.cpp
Jun 6, 2017
0ad1900
Create Queue.h
Jun 6, 2017
3345520
Create Queue.cpp
Jun 6, 2017
7e07267
Add files via upload
Jun 6, 2017
9575e08
SFML works!
Jun 6, 2017
6d0d71e
Set a plane at the bottom fo a screen.
Jun 7, 2017
ca79aa4
bgm added
Jun 7, 2017
ec8fb18
todolist changed
Jun 7, 2017
5a5e0bd
add movement
Jun 7, 2017
cf2e7cb
limit movement
Jun 7, 2017
54ef8a8
add fire
Jun 7, 2017
ddfe363
Add files via upload
Jun 7, 2017
081b53b
Add files via upload
Jun 7, 2017
9486437
Add files via upload
Jun 7, 2017
a4e7765
Add files via upload
Jun 7, 2017
2d1199d
Add files via upload
Jun 7, 2017
6c6d8a8
Add files via upload
Jun 7, 2017
72abc73
fire auto remove
Jun 7, 2017
0930361
rename a picture
Jun 7, 2017
028074b
add enemy
Jun 7, 2017
bf59a41
auto remove enemy out of screen
Jun 7, 2017
4d1fdf5
add kill emeny
Jun 7, 2017
3149428
add boom
Jun 7, 2017
bd26847
Merge remote-tracking branch 'upstream/master'
Jun 7, 2017
61d8839
Merge remote-tracking branch 'origin/master'
Jun 7, 2017
66fadfd
add boom sound
Jun 7, 2017
732a520
add score
Jun 7, 2017
7ce7fa2
add enemy fire
Jun 8, 2017
1e34f4d
add level control
Jun 8, 2017
7874037
finish all!(end by add life control)
Jun 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions practices/c/level1/p01_runningLetter/runningLetter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include<stdio.h>
#include<Windows.h>

int main()
{
int n = 0, pos=0;

while (TRUE)
{
if (n>30)
{
pos = 60 - n;
}
else
{
pos = n;
}
for (int i = 0; i<pos; i++)
{
putchar(' ');
}
putchar('R');
n++;
if (n == 60)
{
n = 0;
}
Sleep(50);
system("cls");
}
return 0;
}
19 changes: 19 additions & 0 deletions practices/c/level1/p02_isPrime/isPrime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>
#include<math.h>

int main()
{
int n,n_sqrt;
scanf("%d",&n);
n_sqrt=sqrt(n);
for(int i=2;i<n_sqrt;i++)
{
if(n%i==0)
{
printf("No");
return 0;
}
}
printf("Yes");
return 0;
}
15 changes: 15 additions & 0 deletions practices/c/level1/p03_Diophantus/Diophantus.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include<stdio>

int main()
{
int i=0;
while(++i)
{
if((i/12.0+i/6.0+i/7.0+5.0+i/2.0+4.0)==i)
{
printf("\n%d",i-4);
break;
}
}
return 0;
}
16 changes: 16 additions & 0 deletions practices/c/level1/p04_ narcissus/narcissus.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>

int main()
{
for(int i=100;i<1000;i++)
{
int a=i/100;
int b=(i-a*100)/10;
int c=i%10;
if(a*a*a+b*b*b+c*c*c==i)
{
printf("%4d",i);
}
}
return 0;
}
34 changes: 34 additions & 0 deletions practices/c/level1/p05_allPrimes/allPrimes.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include<stdio.h>

int main()
{
int a[999];
for(int i=0;i<999;i++)
{
a[i]=i+2;
}
for(int i=0;i<999;i++)
{
for(int j=i;j<999;j++)
{
int n=(i+2)*(j+2);
if(n<=1000)
{
a[n-2]=0;
}
else
{
break;
}
}
}
for(int i=0;i<999;i++)
{
if(a[i]!=0)
{
printf("%4d",a[i]);
}
}

return 0;
}
42 changes: 42 additions & 0 deletions practices/c/level1/p06_Goldbach/Goldbach.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include<stdio.h>
#include<math.h>

int isPrime(int n)
{
int n_sqrt=sqrt(n);
for(int i=2;i<n_sqrt;i++)
{
if(n%i==0)
{
return 0; //0 as false.
}
}
return 1; //1 as true.
}

int count=0;

int main()
{
for(int i=4;i<=100;i+=2)
{
for(int j=2;j<i;j++)
{
if(isPrime(i-j)&&isPrime(j))
{
count++;
break;
}
}
}
if(count!=49)
{
printf("False");
}
else
{
printf("True");
}

return 0;
}
52 changes: 52 additions & 0 deletions practices/c/level1/p07_encrypt_decrypt/encrypt_decrypt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <stdio.h>

void encrypt(char*);
void decrypt(char*);

int main()
{
char a[10000];
char choice;
printf("D:decrypt E:encrypt\n");
scanf("%c",&choice);
if(choice=='D'||choice=='d')
{
printf("Text:");
scanf("%s",a);
encrypt(a);
printf("%s\n",a);
}
else if(choice=='E'||choice=='e')
{
printf("Encrypted text:");
scanf("%s",a);
decrypt(a);
printf("%s\n",a);
}
else
{
printf("Wrong input.");
}
}

void encrypt(char* str)
{
char *ch=str;
while(*ch!='\0')
{
*(ch)^='#';
++*(ch);
++ch;
}
}

void decrypt(char* str)
{
char *ch=str;
while(*ch!='\0')
{
--*(ch);
*(ch)^='#';
++ch;
}
}
23 changes: 23 additions & 0 deletions practices/c/level1/p08_hanoi/hanoi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include<stdio.h>

void hanoi(char,char,char,int);

int main()
{
hanoi('A','B','C',64);
return 0;
}

void hanoi(char source,char temp,char target,int number)
{
if(number==1)
{
printf("move from %c to %c\n",source,target);
}
else
{
hanoi(source,target,temp,number-1);
hanoi(source,temp,target,1);
hanoi(temp,source,target,number-1);
}
}
93 changes: 93 additions & 0 deletions practices/c/level1/p09_maze/maze.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#include<stdio.h>
#include<Windows.h>

char map[11][12]=
{
"OOOOOOOOOOO",
"OKO O O",
"O O O O O O",
"O O O O O",
"OOOOO O O O",
"O O O",
"O OOOOOOO O",
"O O OO O",
"O O O OOOOO",
"O O ",
"OOOOOOOOOOO"
};
int x=1;
int y=1;

void print();

int main()
{
print();
while (true)
{
if (GetKeyState(VK_DOWN) < 0)
{
if (map[y+1][x] == ' ')
{
map[y][x] = ' ';
y += 1;
map[y][x] = 'K';
print();
}
Sleep(100);
}
if (GetKeyState(VK_UP) < 0)
{
if (map[y -1][x] == ' ')
{
map[y][x] = ' ';
y -= 1;
map[y][x] = 'K';
print();
}
Sleep(100);
}
if (GetKeyState(VK_RIGHT) < 0)
{
if (map[y ][x+1] == ' ')
{
map[y][x] = ' ';
x += 1;
map[y][x] = 'K';
print();
}
Sleep(100);
}
if (GetKeyState(VK_LEFT) < 0)
{
if (map[y ][x-1] == ' ')
{
map[y][x] = ' ';
x-=1;
map[y][x] = 'K';
print();
}
Sleep(100);
}

if (x == 10 && y == 9)
{
system("cls");
printf("You win!\n");
Sleep(1000);
break;
}
}
return 0;
}

void print()
{
system("cls");
for (int i = 0; i < 11; i++)
{
printf("%s\n", map[i]);
}
}


Loading