Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ALL HAIL ASTERISK!! FUCK LELOUCH, FUCK BRITTANIA, ASTERISK IS THE THING!!
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <time.h>
- #define distance_tun 5
- //size : 25 X 80
- //distance : 5
- int position = 12,
- tun = 0,
- tunpos[80/distance_tun],
- tunh1[80/distance_tun],
- tunh2[80/distance_tun];
- void arrangearray()
- {
- if(tunpos[0] == 0)
- {
- int i;
- for(i=0; i<(80/distance_tun)-1; i++)
- {
- tunpos[i] = tunpos[i+1];
- tunh1[i] = tunh1[i+1];
- tunh2[i] = tunh2[i+1];
- }
- tunpos[i] = 0;
- }
- }
- void printflap()
- {
- printf("\n\n\n\n\n\n\n\n\n\n\n\n");
- printf(" *");
- printf("\n\n\n\n\n\n\n\n\n\n\n\n");
- for(int i=0; i<80; i++)
- printf("-");
- for(int i=0; i<20; i++)
- tunpos[i] = 0;
- }
- void prntscrnfb()
- {
- system("cls");
- int p;
- for(int n=0; n<25; n++)
- {
- if(n == position)
- {
- printf(" *");
- p=3;
- }
- else p=0;
- if(n < 12)
- {
- for(int i=0; i<80/distance_tun; i++)
- {
- if(tunpos[i] == 0) break;
- for(; p <= tunpos[i]-1; p++)
- printf(" ");
- if(n <= tunh1[i])
- {
- printf("#");
- p++;
- }
- }
- if(n != 24) printf("\n");
- continue;
- }
- if(n > 12)
- {
- for(int i=0; i<80/distance_tun; i++)
- {
- if(tunpos[i] == 0) break;
- for(; p <= tunpos[i]-1; p++)
- printf(" ");
- if(n >= tunh2[i])
- {
- printf("#");
- p++;
- }
- }
- }
- if(n != 24) printf("\n");
- }
- }
- void play(int times=0)
- {
- if(position > 24) return;
- if(tunpos[0] == 2)
- {
- if(position < tunh1[0] || position > tunh2[0])
- return;
- else tun++;
- }
- if(_kbhit())
- if(_getch() == ' ')
- position -= 5;
- //move the screen
- position++;
- for(int i=0; i<80/distance_tun; i++)
- {
- if(tunpos[i] == 0)
- break;
- if(tunpos[i] == 1)
- {
- tunpos[i] = 0;
- arrangearray();
- i--;
- continue;
- }
- tunpos[i]--;
- }
- if(times%(2*distance_tun) == 0)
- {
- int i;
- for(i=0; i<80/distance_tun; i++)
- if(tunpos[i] == 0)
- break;
- tunh1[i] = (rand() % 10)+1;
- tunh2[i] = (rand() % 10)+13;
- tunpos[i] = 70;
- }
- prntscrnfb();
- return play(times+1);
- }
- void main()
- {
- srand(time(NULL));
- while(true)
- {
- printflap();
- play();
- printf("\n\n\n\nCongratulations, you got through %d tunels!\n", tun);
- getchar();
- }
- printf("\n\n\nALL HAIL THE ASTERISK!!\nMade in Portugal by Kimossab the idiot!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement