Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "gfx.h"
- #include <stdlib.h>
- #include <time.h>
- int main()
- { //116
- char c;
- char *test = "Would you like to play a game? Y/N" ;
- char *red = "RED";
- char *lblue = "LIGHT BLUE";
- char *dblue = "DARK BLUE";
- char *yellow = "YELLOW";
- char *dgreen = "DARK GREEN";
- char *lgreen = "LIGHT GREEN";
- char *brown = "BROWN";
- char *purple ="PURPLE";
- char *pink = "PINK";
- char *black = "BLACK";
- char *correct = "CORRECT";
- char *guessone = "You have 1 guess left";
- char *guesstwo = "You have 2 guesses left";
- char *guessthree = "You have 3 guesses left";
- char *end = "Okay, Please come again!";
- char *end1 = "Press any key to exit";
- int score,guess,level,x,y;
- char n;
- srand(time(NULL));
- score = 0;
- guess = 3;
- gfx_open(3000,1000,"bew");
- gfx_clear_color(255,255,255);
- gfx_clear();
- gfx_color(0,0,0);
- gfx_text(test,800,500);
- while (1) {//144
- c = gfx_wait();
- x=gfx_xpos();
- y=gfx_ypos();
- if (c==0x01)
- {
- }
- else if (c==0x02)
- {
- printf("2 - middle button ");
- }
- else if (c==0x03)
- {
- printf("3 - right button ");
- }
- /* else
- {
- printf("%c \n",c);
- printf("Mouse pos xpos is %d and ypos is %d \n", gfx_xpos(),gfx_ypos());
- }
- if ((x >= 200 && x <= 400) && (y >= 100 && y <= 300))
- {//123
- printf("Correct \n");
- //gfx_color(255,255,0);
- //gfx_fillcircle(50,500,100);
- }//121*/
- //c = gfx_wait();
- if ((c =='Y') || (c == 'y'))
- {//111
- gfx_clear();
- gfx_text(red,100,100);
- // setting line color
- gfx_color(0,0,0);
- //drawing vertical grid
- gfx_line(600,0,600,1000);
- gfx_line(800,0,800,1000);
- gfx_line(1000,0,1000,1000);
- //drawing horizontal grid
- gfx_line(600,200,1000,200);
- gfx_line(600,400,1000,400);
- gfx_line(600,600,1000,600);
- gfx_line(600,800,1000,800);
- gfx_line(600,1000,1000,1000);
- // drawing in circles with different colors
- gfx_color(0,0,0); //black
- gfx_fillcircle(700,100,150);
- gfx_circle(700,100,150);
- gfx_color(255,0,0); //red
- gfx_fillcircle(900,100,150);
- gfx_circle(900,100,150);
- gfx_color(0,255,0); //light green
- gfx_fillcircle(700,300,150);
- gfx_circle(700,300,150);
- gfx_color(0,0,255); //light blue
- gfx_fillcircle(900,300,150);
- gfx_circle(900,300,150);
- gfx_color(255,255,0); //yellow
- gfx_fillcircle(700,500,150);
- gfx_circle(700,500,150);
- gfx_color(0,128,0); //dark green
- gfx_fillcircle(900,500,150);
- gfx_circle(900,500,150);
- gfx_color(255,0,255); //pink
- gfx_fillcircle(700,700,150);
- gfx_circle(700,700,150);
- gfx_color(128,0,128); //purple
- gfx_fillcircle(900,700,150);
- gfx_circle(900,700,150);
- gfx_color(0,0,100); //dark blue
- gfx_fillcircle(700,900,150);
- gfx_circle(700,900,150);
- gfx_color(65,42,42); //brown
- gfx_fillcircle(900,900,150);
- gfx_circle(900,900,150);
- if ((x >= 800 && x <= 1000) || (y >= 0 && y <= 200)) // decision making part
- {
- printf("CORRECT\n");
- }
- }//53
- }//48
- }//8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement