Professional Web Applications Themes

need help debugging old school BASIC program - Mac Programming

this basic program (simple poetry-generating program) keeps giving me errors. I'm using the free Chipmunk Basic on OSX. Any help apprectiated.. 10 rem hanshan 20 gosub 250 : rem initialize 30 rem choose pattern 40 r = int(rnd(1)*3)+1 50 on r gosub 90,140,190 60 for t = 1 to 2500 : next t 70 print : print : print 80 goto 40 90 rem ** pattern one ** 100 color 14 : print w$(int(rnd(1)*20+1));"...";w$(int(rnd(1)*20+1)) 110 print tab (5);"...";w$(int(rnd(1)*20+1)) 120 print tab (8);s$(int(rnd(1)*20+1)) 130 return 140 rem ** pattern two ** 150 color 10 : print s$(rnd(1)*20+1)) 160 print tab (3);s$(int(rnd(1)*20+1));"..." ...

  1. #1

    Default need help debugging old school BASIC program

    this basic program (simple poetry-generating program) keeps giving me
    errors. I'm using the free Chipmunk Basic on OSX. Any help apprectiated..

    10 rem hanshan
    20 gosub 250 : rem initialize
    30 rem choose pattern
    40 r = int(rnd(1)*3)+1
    50 on r gosub 90,140,190
    60 for t = 1 to 2500 : next t
    70 print : print : print
    80 goto 40
    90 rem ** pattern one **
    100 color 14 : print w$(int(rnd(1)*20+1));"...";w$(int(rnd(1)*20+1))
    110 print tab (5);"...";w$(int(rnd(1)*20+1))
    120 print tab (8);s$(int(rnd(1)*20+1))
    130 return
    140 rem ** pattern two **
    150 color 10 : print s$(rnd(1)*20+1))
    160 print tab (3);s$(int(rnd(1)*20+1));"..."
    170 print tab (6);s$(int(rnd(1)*20+1))
    180 return
    190 rem ** pattern three **
    200 color 15 : print tab (3);w$(int(rnd(1)*20+1))
    210 print s$(int(rnd(1)*20+1))
    220 print tab (3);w$(int(rnd(1)*20+1));",";s$(int(rnd(1)*20+1))
    230 return
    240 rem ****************
    250 rem initialization
    260 width 40
    270 randomize val(right$(time$,2))
    280 dim w$(20),s$(20)
    290 for j = 1 to 20
    300 read w$(j)
    310 next j
    320 for j = 1 to 20
    330 read s$(j)
    340 next j
    350 return
    360 rem ** data **
    370 rem ** single words **
    380 data "scurrying","trading","gazing","withered","chisell ed"
    390 data "muffled","flanked","writhed","bending","twist ing"
    400 data "hammered","hanging","winding","clearest","wea ry"
    410 data "earthworld","cataract","sacrificial","slippery"," assunder"
    420 data " ** short phrases **"
    430 data "in" "the" "cool" "stream"
    440 data "nodded in clustered grace"
    450 data "waves" "of" "coolness"
    460 data "out from the deepest"
    470 data "sullen","sullen"
    480 data "in the black darkness"
    490 data "i" "take" "your" "poems"
    500 data "i put out the lamp"
    510 data "my" "short" "span" "runs" "out"
    520 data "those" "that" "are" "left"
    530 data "men or learning"
    540 data "men" "of" "action"
    550 data "I" "HURRY" "FORWARD"
    560 data "WHY" "SHOULD" "YOU" "WASTE"
    570 data "WHEN" "SHALL" "WE" "MEET"
    580 data "LITTLE" "SLEEPING"
    590 data and "MUCH" "GRIEVING"
    600 data for "THOS" "FEW" "STEPS"
    610 data "NOW" "AT" "DUSK"
    620 data "I" "HAVE" "DONE" "WITH" "PROFIT"

    Marco Guest

  2. #2

    Default RE: need help debugging old school BASIC program

    10 rem hanshan
    20 gosub 250 : rem initialize
    30 rem choose pattern
    40 r = int(rnd(1)*3)+1
    50 on r gosub 90,140,190
    60 for t = 1 to 2500 : next t
    70 print : print : print
    80 goto 40
    90 rem ** pattern one **
    100 color 14 : print w$(int(rnd(1)*20+1));"...";w$(int(rnd(1)*20+1))
    110 print tab (5);"...";w$(int(rnd(1)*20+1))
    120 print tab (8);s$(int(rnd(1)*20+1))
    130 return
    140 rem ** pattern two **
    150 color 10 : print s$(rnd(1)*20+1))
    160 print tab (3);s$(int(rnd(1)*20+1));"..."
    170 print tab (6);s$(int(rnd(1)*20+1))
    180 return
    190 rem ** pattern three **
    200 color 15 : print tab (3);w$(int(rnd(1)*20+1))
    210 print s$(int(rnd(1)*20+1))
    220 print tab (3);w$(int(rnd(1)*20+1));",";s$(int(rnd(1)*20+1))
    230 return
    240 rem ****************
    250 rem initialization
    260 width 40
    270 randomize val(right$(time$,2))
    280 dim w$(20),s$(20)
    290 for j = 1 to 20
    300 read w$(j)
    310 next j
    320 for j = 1 to 20
    330 read s$(j)
    340 next j
    350 return
    360 rem ** data **
    370 rem ** single words **
    380 data "scurrying","trading","gazing","withered","chisell ed"
    390 data "muffled","flanked","writhed","bending","twist ing"
    400 data "hammered","hanging","winding","clearest","wea ry"
    410 data "earthworld","cataract","sacrificial","slippery"," assunder"
    420 rem ** short phrases **
    430 data "in" "the" "cool" "stream"
    440 data "nodded in clustered grace"
    450 data "waves" "of" "coolness"
    460 data "out from the deepest"
    470 data "sullen","sullen"
    480 data "in the black darkness"
    490 data "i take your poems"
    500 data "i put out the lamp"
    510 data "my short span runs out"
    520 data "those that are left"
    530 data "men or learning"
    540 data "men of action"
    550 data "i hurry forward"
    560 data "why should you waste"
    570 data "when shall we meet"
    580 data "little sleeping"
    590 data "and much grieving"
    600 data "for thos few steps"
    610 data "now at dusk"
    620 data "i have done with profit"
    Not Guest

  3. #3

    Default Re: need help debugging old school BASIC program

    On 24/06/2004, Marco wrote in message
    <NJFCc.4997$tampabay.rr.com>:
     

    /What/ errors ? Tell us what it says and when.
     

    Aren't you meant to have commas in there ?

    Simon.
    --
    Using pre-release version of newsreader.
    Please tell me if it does weird things.
    Simon Guest

  4. #4

    Default Re: need help debugging old school BASIC program

    In article <cbkulb$751$1$demon.co.uk>,
    Simon Slavin
    <demon.co.uk> wrote:
     
    >
    > /What/ errors ? Tell us what it says and when.

    >
    > Aren't you meant to have commas in there ?
    >
    > Simon.[/ref]

    Actually..., no!

    Those look to be meant as complete one line strings.

    The first 20 are single words, the next 20 are single line
    phrases. Thus that should be -

    430 data "in the cool stream"

    Of course it's been over 20 years since I've done anything with
    BASIC and I don't remember it very much.
    Not Guest

Similar Threads

  1. Replies: 4
    Last Post: January 14th, 10:07 AM
  2. best setup for school laptop program
    By Malke in forum Windows Server
    Replies: 5
    Last Post: June 7th, 01:44 PM
  3. Basic Flash Help & Graphic Program Reccomendation
    By Jaggz in forum Macromedia Flash
    Replies: 1
    Last Post: October 4th, 07:43 PM
  4. Unable to start debugging error (Basic Authentication)
    By Debugger in forum ASP.NET General
    Replies: 0
    Last Post: July 25th, 03:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139