|  | |  |
05-23-2004, 10:52 AM
|
#1 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| what language is this? Code: !this is a program that allows the user a chance to click in a box that has an image
!appear in it. It then tells the user how long it took for them to click the boxes.
!a random city scene to demonstrate my graphic ability
PRINT "Welcome to my program. You will be asked to pay attention"
PRINT "to where some figures appear in a grid for later use."
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT "Press any key to continue..."
PRINT " and ENJOY THE VIEW!"
GET KEY dummy
SET MODE "graphics"
SET WINDOW 0, 3, 0, 3
BOX LINES 1, 2, 1, 2 !makes a box on the screen
!the following lines give the dimensions and colors for the city buildings
BOX LINES 1, 1.15, 1, 1.5
SET COLOR "253"
FLOOD 1.1, 1.2
BOX LINES 1.15, 1.29, 1, 1.8
SET COLOR "251"
FLOOD 1.16, 1.7
BOX LINES 1.29, 1.41, 1, 1.65
SET COLOR "254"
FLOOD 1.31, 1.63
BOX LINES 1.41, 1.53, 1, 1.49
SET COLOR "253"
FLOOD 1.42, 1.48
BOX LINES 1.53, 1.67, 1, 1.75
SET COLOR "251"
FLOOD 1.54, 1.6
BOX LINES 1.67, 1.85, 1, 1.4
SET COLOR "252"
FLOOD 1.7, 1.3
BOX LINES 1.85, 2, 1, 1.84
SET COLOR "253"
FLOOD 1.9, 1.8
!the moon in the sky
BOX CIRCLE 1.75, 1.85, 1.85, 1.98
SET COLOR "2"
FLOOD 1.76, 1.95
!the color of the sky is a deep blue
SET COLOR "239"
FLOOD 1.1, 1.9
PAUSE 2.5
CLEAR
!****************************************************************************************************************
SET MODE "graphics"
RANDOMIZE
LET n = 4
LET wm = 1
LET ratio = 640/480
SET WINDOW 0-(wm*ratio), n+(wm*ratio), 0-wm, n+wm
CALL icon(n,rainbow$,im)
CALL grid(n)
CALL showbox(n,rainbow$,im,p)
CALL clicker(p,n)
PAUSE 1
PRINT "Thanks for using my program. Click anywhere to return to the beginning."
END
!beginning of subroutines
!****************************************************************************************************************
SUB icon(n,rainbow$,im)
LET im = 0.06
!the rainbow colored lines that will appear in each box
SET COLOR "red"
BOX LINES 0+im, 1-im, n-1+im, n-im
SET COLOR "yellow"
BOX LINES .1+im, .9-im, n-.9+im, n-im
SET COLOR "green"
BOX LINES .2+im, .8-im, n-.8+im, n-im
SET COLOR "blue"
BOX LINES .3+im, .7-im, n-.7+im, n-im
SET COLOR "90"
BOX LINES .4+im, .6-im, n-.6+im, n-im
BOX KEEP 0+im, 1-im, n-1+im, n-im IN rainbow$
SET COLOR "black"
PRINT "Pay attention to where the box, shown below, full of colorful lines appears."
PRINT "Press any key to continue..."
GET KEY dummy
PLAY "d"
PAUSE 1
CLEAR
END SUB
!****************************************************************************************************************
SUB grid(n)
SET COLOR "black"
FOR r = 1 to n
FOR c = 1 to n
BOX LINES c-1, c, r-1, r
PAUSE 0.5
NEXT c
NEXT r
PAUSE 1
END SUB
!****************************************************************************************************************
SUB showbox(n,rainbow$,im,p)
LET p = 3
FOR i = 1 to p
LET r = int(n*rnd) + 1
LET c = int(n*rnd) + 1
BOX SHOW rainbow$ at c-1+im, r-1+im
PLAY "d"
PAUSE 0.5
BOX CLEAR c-1+im, c-im, r-1+im, r-im
PAUSE 0.5
NEXT i
END SUB
!****************************************************************************************************************
SUB clicker(p,n)
PLAY "c d"
PRINT "Click the mouse on the squares where you saw the colorful boxes..."
LET startTime = TIME
LET clicks = 0
DO
DO
GET MOUSE x, y, s
LOOP until s = 3
PLAY "g"
CALL finder(x,y,n,c,r)
IF c = 0 and r = o then
PRINT "clicked out of grid"
ELSE
PRINT "column="; c ; " row=" ; r
END IF
LET clicks = clicks + 1
LOOP until clicks = p
LET endTime = TIME
LET elapsedTime = endTime - startTime
LET elapsedTime = round(elapsedTime, 1)
PRINT "It took you" ; elapsedTime ; "seconds!"
END SUB
!***********************************************************************************************************
SUB finder(x,y,n,c,r)
IF x < 0 or y < 0 or x>= n or y >=n then
LET c = 0
LET r = 0
ELSE
LET c = int(x) + 1
LET r = int(y) + 1
END IF
END SUB
__________________ Mike |
| |
05-23-2004, 02:51 PM
|
#2 (permalink)
| | Code Monkey
Join Date: Jul 2003 Location: canada
Posts: 82
| looks like a dos batch file.
__________________ direct entry file specification. |
| |
05-24-2004, 02:38 PM
|
#3 (permalink)
| | Senior Grasshopper
Join Date: Jun 2003 Location: FL
Posts: 317
| Perhaps some form of BASIC. (true basic ?? )
Just guessing from the `end sub` syntax and the use of FLOOD.
-r |
| |
05-24-2004, 09:11 PM
|
#4 (permalink)
| | Regular Contributor
Join Date: Mar 2003 Location: Las Vegas, NV
Posts: 131
| Looks highly antiquated. I wouldn't mess with it. It's not worth it.
__________________ --Epsilon--
Last edited by Epsilon; 05-24-2004 at 09:34 PM.
|
| |
05-24-2004, 09:22 PM
|
#5 (permalink)
| | Super Moderator
Join Date: Jun 2002 Location: Denmark
Posts: 1,879
| Rewrite it in the language of your choice, then maintain it from there. |
| |
05-25-2004, 04:29 AM
|
#6 (permalink)
| | Regular Contributor
Join Date: May 2002 Location: Alkmaar, the Netherlands
Posts: 167
| makes me think of fortran .. but not because of the synaxt .. been too long since i used fortran .. just gave me some memories
__________________ The specialty of the house? thats me (cheap as always) |
| |
05-25-2004, 12:56 PM
|
#7 (permalink)
| | Registered User
Join Date: May 2004
Posts: 47
| hmm, it's definitely not fortran 77, my father was a fortran programmer and he showed me some of his big programs, that fortran reminded me of C in ways. |
| |
05-25-2004, 01:03 PM
|
#8 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| it was just code someone did in school a long time ago .. they asked me what language it was.
thanks =)
__________________ Mike |
| |
05-25-2004, 01:22 PM
|
#9 (permalink)
| | Registered User
Join Date: May 2004
Posts: 47
| So was it ever determined what language it was?
Maybe I just missed something but I am very curious now as to what it is. |
| |
05-25-2004, 01:25 PM
|
#10 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| i think idx was along the right track.. basic? but no, it wasn't determined for sure.
__________________ Mike |
| |
05-25-2004, 03:57 PM
|
#11 (permalink)
| | Java fanboy
Join Date: Aug 2003
Posts: 1,230
| It looks like Basic. PLAY was a command I think, and I know PRINT was. It might be QBasic, I think you can get away with not having line numbers in QBasic, but not Basic. I know I learned QBasic in high school, but I've forgotten most if it. |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 06:23 PM. |
Copyright © 2000-2008, Milano Interactive Web Hosting provided by Portal 360 Web Hosting |  | |