Sunday, September 2, 2018

HOW TO CREATE A SIMPLE LETTER PUZZLE GAME FROM QBASIC?

QBASIC is a simple high level programming language mainly used to for educational purpose for secondary level students. It is easy and gives simple concepts about the programming world. 
can we make a game with qbasic

Here is a simple letter puzzle game code made by me from QBASIC when I was a grade 9 student. The main concept of this game is that different letters are given to you and you should trun it into a meaningful world. Let's see the program code :-

CLS
COLOR 3
PRINT
INPUT "ENTER YOUR NAME"; N$
PRINT
PRINT N$
PRINT "WELCOME  TO  PUZZLE  GAME"
PRINT
INPUT "ARE YOU READY TO PLAY (YES OR  NO)"; R$
IF UCASE$(R$) = "NO" THEN GOTO LBL:
PRINT
PRINT "WRITE IN UCASE"
PRINT
XYZ:
PRINT "CHOOSE ANY NUMBER"
D = D + 1
PRINT
PRINT "1    2    3    4"
PRINT
INPUT "ENTER A NUMBER"; A
PRINT
IF A = 1 THEN
    PRINT "THE  PUZZLE  IS"
    PRINT
    PRINT " T E R E S E V"
    PRINT
    INPUT "ENTER THE CORRECT ANSWER"; F$
    IF F$ = "EVEREST" THEN
        COLOR 2
        C = C + 1
        PRINT N$
        PRINT "YOU GAVE CORRECT ANSWER"
    ELSE
        COLOR 13
        W = W + 1
        PRINT "YOU GAVE WRONG ANSWER"
        PRINT
        PRINT "THE CORRECT ANSWER IS EVEREST"
        GOTO JOCK:
    END IF
END IF
IF A = 2 THEN
    PRINT "THE  PUZZLE  IS"
    PRINT
    PRINT " D R S I Y N T U"
    PRINT
    INPUT "ENTER THE CORRECT ANSWER"; M$
    PRINT
    IF M$ = "INDUSTRY" THEN
        COLOR 2
        C = C + 1
        PRINT N$
        PRINT "YOU GAVE CORRECT ANSWER"
    ELSE
        COLOR 13
        W = W + 1
        PRINT "YOU GAVE WRONG ANSWER"
        PRINT
        PRINT "THE CORRECT ANSWER IS INDUSTRY"
        GOTO JOCK:
    END IF
END IF
IF A = 3 THEN
    PRINT "THE  PUZZLE  IS"
    PRINT
    PRINT " T I A R Y D B H"
    PRINT
    INPUT "ENTER THE CORRECT ANSWER"; O$
    PRINT
    IF O$ = "BIRTHDAY" THEN
        COLOR 2
        C = C + 1
        PRINT N$
        PRINT "YOU GAVE CORRECT ANSWER"
    ELSE
        COLOR 13
        W = W + 1
        PRINT "YOU GAVE WRONG ANSWER"
        PRINT
        PRINT "THE CORRECT ANSWER IS BIRTHDAY"
        GOTO JOCK:
    END IF
END IF
IF A = 4 THEN
    PRINT "THE  PUZZLE  IS"
    PRINT
    PRINT " G S N H I E L"
    PRINT
    INPUT "ENTER THE CORRECT ANSWER"; K$
    PRINT
    IF K$ = "ENGLISH" THEN
        COLOR 4
        C = C + 1
        PRINT N$
        PRINT "YOU GAVE CORRECT ANSWER"
    ELSE
        COLOR 13
        W = W + 1
        PRINT "YOU GAVE WRONG ANSWER"
        PRINT
        PRINT "THE CORRECT ANSWER IS ENGLISH"
        GOTO JOCK:
    END IF
END IF
JOCK:
INPUT "YOU WANT TO PLAY MORE (YES OR NO)"; Z$
IF Z$ = "YES" THEN GOTO XYZ:
PER = (C / D) * 100
PRINT
PRINT "TOTAL TIME PLAYED BY YOU ="; D
PRINT
PRINT "TOTAL CORRECT ANSWER IS ="; C
PRINT
PRINT "TOTAL WRONG ANSWER IS ="; W
PRINT
PRINT "TOTAL INTELLEGENCE % IS ="; PER
PRINT
PRINT "THANKS FOR PLAYING"
GOTO PQR:
LBL:
PRINT
COLOR 13
PRINT "YOU ARE NOT READY"
PRINT "SO YOU SHOULD EXIT FROM THIS GAME"
PRINT "THANKS"
PRINT
PQR:
PRINT
PRINT
COLOR 25
PRINT "THIS GAME IS  DEVELOPED BY :"
PRINT "edurat.blogspot.com"
PRINT
END

[ IF YOU HAVE ANY QUERY OR SUGGESTION THEN FEEL FREE TO COMMENT BELOW. KEEP VISITING Edurat.blogspot.com TO BOOST YOUR KNOWLEDGE. THANK YOU. ]
Disqus Comments