Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-23-2004, 10:52 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 05-23-2004, 02:51 PM   #2 (permalink)
npa
Code Monkey
 
Join Date: Jul 2003
Location: canada
Posts: 82
npa is on a distinguished road
looks like a dos batch file.
__________________
direct entry file specification.
npa is offline   Reply With Quote
Old 05-24-2004, 02:38 PM   #3 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Perhaps some form of BASIC. (true basic ?? )

Just guessing from the `end sub` syntax and the use of FLOOD.

-r
idx is offline   Reply With Quote
Old 05-24-2004, 09:11 PM   #4 (permalink)
Epsilon
Regular Contributor
 
Epsilon's Avatar
 
Join Date: Mar 2003
Location: Las Vegas, NV
Posts: 127
Epsilon is on a distinguished road
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.
Epsilon is offline   Reply With Quote
Old 05-24-2004, 09:22 PM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
Rewrite it in the language of your choice, then maintain it from there.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 05-25-2004, 04:29 AM   #6 (permalink)
Hrqls
Regular Contributor
 
Join Date: May 2002
Location: Alkmaar, the Netherlands
Posts: 167
Hrqls is on a distinguished road
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)
Hrqls is offline   Reply With Quote
Old 05-25-2004, 12:56 PM   #7 (permalink)
Amaranthine
Registered User
 
Amaranthine's Avatar
 
Join Date: May 2004
Posts: 47
Amaranthine is on a distinguished road
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.
Amaranthine is offline   Reply With Quote
Old 05-25-2004, 01:03 PM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
it was just code someone did in school a long time ago .. they asked me what language it was.

thanks =)
__________________
Mike
sde is offline   Reply With Quote
Old 05-25-2004, 01:22 PM   #9 (permalink)
Amaranthine
Registered User
 
Amaranthine's Avatar
 
Join Date: May 2004
Posts: 47
Amaranthine is on a distinguished road
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.
Amaranthine is offline   Reply With Quote
Old 05-25-2004, 01:25 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
i think idx was along the right track.. basic? but no, it wasn't determined for sure.
__________________
Mike
sde is offline   Reply With Quote
Old 05-25-2004, 03:57 PM   #11 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
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.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What programming language were these games made in? Sanehouse All Other Coding Languages 7 08-18-2004 05:02 AM
Programming Language Invengor or Serial Killer? sde Lounge 8 04-18-2004 06:55 PM
Newbie Help (Japanese Language Support) DasXel Linux / BSD / OS X 11 01-14-2003 06:20 AM
Alright Im here! Someone tell me,,, is this the language I wanna start with? TVance Standard C, C++ 5 12-27-2002 03:05 PM


All times are GMT -8. The time now is 02:08 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting