Sign in to follow this  
ShotgunNinja

QBasic Iso program

Recommended Posts

ShotgunNinja    102
I made a Qbasic program for making simple cubes in isometric (or at least in ortho, but it looks like iso). Here it is: 0 : CLS PRINT " Box Draw " PRINT "************************" PRINT " Please enter length: " INPUT L# PRINT " Please enter width: " INPUT W# PRINT " Please enter depth: " INPUT D# PRINT " Clear or not? (1/0) " INPUT C# CLS PRINT " Loading... " SLEEP 1 V# = L# * W# * D# D# = D# * .6 SCREEN 7 P# = 100 - (L# / 2) PSET (P#, P#) PSET (P# - L#, P#) PSET (P# - L#, P# - W#) PSET (P#, P# - W#) A# = L# * .5 B# = INT(SQR((D# * D#) - (A# * A#))) PSET (P# - L# - A#, P# - B#) PSET (P# - L# - A#, P# - W# - B#) PSET (P# - A#, P# - W# - B#) LINE (P#, P#)-(P#, P# - W#) LINE (P#, P#)-(P# - L#, P#) LINE (P# - L#, P#)-(P# - L#, P# - W#) LINE (P#, P# - W#)-(P# - L#, P# - W#) LINE (P# - L#, P#)-(P# - L# - A#, P# - B#) LINE (P#, P# - W#)-(P# - A#, P# - W# - B#) LINE (P# - L#, P# - W#)-(P# - L# - A#, P# - W# - B#) LINE (P# - L# - A#, P# - B#)-(P# - L# - A#, P# - W# - B#) LINE (P# - A#, P# - W# - B#)-(P# - L# - A#, P# - W# - B#) IF C# = 1 THEN GOTO 2 ELSEIF C# = 0 THEN GOTO 1 ELSE GOTO 0 END IF 1 : PSET (P# - A#, P# - B#) LINE (P#, P#)-(P# - A#, P# - B#) LINE (P# - A#, P# - B#)-(P# - L# - A#, P# - B#) LINE (P# - A#, P# - B#)-(P# - A#, P# - W# - B#) 2 : PRINT "Volume:"; V# END Try it! EDIT: Whoops, there's a bug. Sorry...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this