Loading ...
Sorry, an error occurred while loading the content.

RE: [sparetimegizmos] Re: Basic Game for Elf2K

Expand Messages
  • Andrew Wasson
    Hi Al, The line number thing with print statements is the only hickup I ve found. Otherwise BASIC runs like a champ! I haven t PEEK d or POKE d anything and
    Message 1 of 4 , May 1, 2006
    • 0 Attachment
      Hi Al,
      The line number thing with print statements is the only hickup I've found.
      Otherwise BASIC runs like a champ!
      I haven't PEEK'd or POKE'd anything and I'd like to dig into it further to
      see what it can do with more complex calculations, arrays, I/O, etc...

      Nice guessing game program by the way. Really compact and fun to play. I
      played with it for a while last night. My wife thought I was doing something
      very clever as she watched the terminal screen scrolling with all sorts of
      messages... until I told her what it was. ;-)

      Andrew

      _____

      From: sparetimegizmos@yahoogroups.com
      [mailto:sparetimegizmos@yahoogroups.com] On Behalf Of Al Williams
      Sent: Sunday, April 30, 2006 7:38 PM
      To: sparetimegizmos@yahoogroups.com
      Subject: [sparetimegizmos] Re: Basic Game for Elf2K


      Oh. And notice the IF A<0 line? When I tried A=-1 that produced a
      syntax error. Didn't try A=(-1) or anything exotic like that...


      --- In sparetimegizmos@yahoogroups.com, "Al Williams" <alw@...> wrote:
      >
      > So still a few BASIC "hangs" on the ELF... But here's a little program
      > I've written a few dozen times over the years for everything from an
      > HP41C to a Univac 1108. Let the computer guess your number. On this
      > occasion, I was showing my son's girlfriend's teenaged son how to
      program:
      >
      > 1 REM HI LO GAME IN ELF BASIC -- AL WILLIAMS
      > 2 REM (PORTED FROM A FEW DOZEN OTHER MACHINES)
      > 10 H=1024
      > 20 L=1
      > 30 PRINT "THINK OF A NUMBER BETWEEN 1 AND 1024"
      > 40 T=1
      > 50 G=(H+L)/2
      > 60 PRINT "IS IT ";G;"? ENTER 1 FOR HIGH, 0 FOR CORRECT, -1 FOR LOW"
      > 70 INPUT A
      > 80 IF A=0 THEN GOTO 500
      > 90 IF A=1 THEN GOTO 600
      > 100 IF A<0 THEN GOTO 700
      > 110 GOTO 60
      > 500 PRINT "I'M SO SMART! I GOT IT IN ";T;" TRIES"
      > 510 END
      > 600 T=T+1
      > 610 H=G
      > 620 GOTO 50
      > 700 T=T+1
      > 710 L=G
      > 720 GOTO 50
      >
      > Have fun!
      >
      > 73 de WD5GNR
      >







      SPONSORED LINKS
      Spare
      <http://groups.yahoo.com/gads?t=ms&k=Spare+time&w1=Spare+time&w2=Craft+hobby
      &w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg&
      c=6&s=116&.sig=S3dNuPtnLupYZguQZ_O7Pg> time Craft
      <http://groups.yahoo.com/gads?t=ms&k=Craft+hobby&w1=Spare+time&w2=Craft+hobb
      y&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg
      &c=6&s=116&.sig=S9IJGbEzVapF3MQi2PPNiA> hobby Hobby
      <http://groups.yahoo.com/gads?t=ms&k=Hobby+and+craft+supply&w1=Spare+time&w2
      =Craft+hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electro
      nics&w6=Stg&c=6&s=116&.sig=aM7dAhzCONoGKfMWfWD9rw> and craft supply
      Home
      <http://groups.yahoo.com/gads?t=ms&k=Home+electronics&w1=Spare+time&w2=Craft
      +hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w
      6=Stg&c=6&s=116&.sig=IPM_mMukr8RoMExCIyQWXw> electronics Marine
      <http://groups.yahoo.com/gads?t=ms&k=Marine+electronics&w1=Spare+time&w2=Cra
      ft+hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics
      &w6=Stg&c=6&s=116&.sig=zg1jAquIjb4ZtJebUTBDMA> electronics Stg
      <http://groups.yahoo.com/gads?t=ms&k=Stg&w1=Spare+time&w2=Craft+hobby&w3=Hob
      by+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg&c=6&s=1
      16&.sig=qbtEJ-0YjTZRhFcJRw_OfQ>

      _____

      YAHOO! GROUPS LINKS



      * Visit your group "sparetimegizmos
      <http://groups.yahoo.com/group/sparetimegizmos> " on the web.


      * To unsubscribe from this group, send an email to:
      sparetimegizmos-unsubscribe@yahoogroups.com
      <mailto:sparetimegizmos-unsubscribe@yahoogroups.com?subject=Unsubscribe>


      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
      <http://docs.yahoo.com/info/terms/> .


      _____




      [Non-text portions of this message have been removed]
    • Al Williams
      Glad you liked it. Here s the same thing in Forth for no particular reason (other than no freezes in Forth): VARIABLE H VARIABLE L VARIABLE G VARIABLE T ...
      Message 2 of 4 , May 1, 2006
      • 0 Attachment
        Glad you liked it. Here's the same thing in Forth for no particular
        reason (other than no freezes in Forth):

        VARIABLE H
        VARIABLE L
        VARIABLE G
        VARIABLE T
        : HILOINIT 0 L ! 1024 H ! 1 T ! ." THINK OF A NUMBER FROM 1 TO 1024 " ;
        : NEWGUESS H @ L @ + 2 / G ! ;
        : GUESS NEWGUESS G @ ." I GUESS " . ." IS THAT (C)ORRECT, (H)IGH, OR
        (L)OW? " BEGIN KEY DUP 67 = SWAP DUP 72 = SWAP -ROT OR SWAP DUP 76 =
        SWAP -ROT OR NOT UNTIL ;
        : HILOGIC WIN HIGH LOW DROP ;
        : HILO HILOINIT T @ WHILE CR GUESS HILOGIC T @ REPEAT ;
        : WIN DUP 67 = IF CR ." HOORAY! I GOT IT IN " T @ . ." TRIES. " 0 T !
        THEN ;
        : HIGH DUP 72 = IF G @ H ! 1 T +! THEN ;
        : LOW DUP 76 = IF G @ L ! 1 T +! THEN ;

        --- In sparetimegizmos@yahoogroups.com, Andrew Wasson <andrew@...> wrote:
        >
        > Hi Al,
        > The line number thing with print statements is the only hickup I've
        found.
        > Otherwise BASIC runs like a champ!
        > I haven't PEEK'd or POKE'd anything and I'd like to dig into it
        further to
        > see what it can do with more complex calculations, arrays, I/O, etc...
        >
        > Nice guessing game program by the way. Really compact and fun to play. I
        > played with it for a while last night. My wife thought I was doing
        something
        > very clever as she watched the terminal screen scrolling with all
        sorts of
        > messages... until I told her what it was. ;-)
        >
        > Andrew
        >
        > _____
        >
        > From: sparetimegizmos@yahoogroups.com
        > [mailto:sparetimegizmos@yahoogroups.com] On Behalf Of Al Williams
        > Sent: Sunday, April 30, 2006 7:38 PM
        > To: sparetimegizmos@yahoogroups.com
        > Subject: [sparetimegizmos] Re: Basic Game for Elf2K
        >
        >
        > Oh. And notice the IF A<0 line? When I tried A=-1 that produced a
        > syntax error. Didn't try A=(-1) or anything exotic like that...
        >
        >
        > --- In sparetimegizmos@yahoogroups.com, "Al Williams" <alw@> wrote:
        > >
        > > So still a few BASIC "hangs" on the ELF... But here's a little program
        > > I've written a few dozen times over the years for everything from an
        > > HP41C to a Univac 1108. Let the computer guess your number. On this
        > > occasion, I was showing my son's girlfriend's teenaged son how to
        > program:
        > >
        > > 1 REM HI LO GAME IN ELF BASIC -- AL WILLIAMS
        > > 2 REM (PORTED FROM A FEW DOZEN OTHER MACHINES)
        > > 10 H=1024
        > > 20 L=1
        > > 30 PRINT "THINK OF A NUMBER BETWEEN 1 AND 1024"
        > > 40 T=1
        > > 50 G=(H+L)/2
        > > 60 PRINT "IS IT ";G;"? ENTER 1 FOR HIGH, 0 FOR CORRECT, -1 FOR LOW"
        > > 70 INPUT A
        > > 80 IF A=0 THEN GOTO 500
        > > 90 IF A=1 THEN GOTO 600
        > > 100 IF A<0 THEN GOTO 700
        > > 110 GOTO 60
        > > 500 PRINT "I'M SO SMART! I GOT IT IN ";T;" TRIES"
        > > 510 END
        > > 600 T=T+1
        > > 610 H=G
        > > 620 GOTO 50
        > > 700 T=T+1
        > > 710 L=G
        > > 720 GOTO 50
        > >
        > > Have fun!
        > >
        > > 73 de WD5GNR
        > >
        >
        >
        >
        >
        >
        >
        >
        > SPONSORED LINKS
        > Spare
        >
        <http://groups.yahoo.com/gads?t=ms&k=Spare+time&w1=Spare+time&w2=Craft+hobby
        >
        &w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg&
        > c=6&s=116&.sig=S3dNuPtnLupYZguQZ_O7Pg> time Craft
        >
        <http://groups.yahoo.com/gads?t=ms&k=Craft+hobby&w1=Spare+time&w2=Craft+hobb
        >
        y&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg
        > &c=6&s=116&.sig=S9IJGbEzVapF3MQi2PPNiA> hobby Hobby
        >
        <http://groups.yahoo.com/gads?t=ms&k=Hobby+and+craft+supply&w1=Spare+time&w2
        >
        =Craft+hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electro
        > nics&w6=Stg&c=6&s=116&.sig=aM7dAhzCONoGKfMWfWD9rw> and craft supply
        > Home
        >
        <http://groups.yahoo.com/gads?t=ms&k=Home+electronics&w1=Spare+time&w2=Craft
        >
        +hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w
        > 6=Stg&c=6&s=116&.sig=IPM_mMukr8RoMExCIyQWXw> electronics Marine
        >
        <http://groups.yahoo.com/gads?t=ms&k=Marine+electronics&w1=Spare+time&w2=Cra
        >
        ft+hobby&w3=Hobby+and+craft+supply&w4=Home+electronics&w5=Marine+electronics
        > &w6=Stg&c=6&s=116&.sig=zg1jAquIjb4ZtJebUTBDMA> electronics Stg
        >
        <http://groups.yahoo.com/gads?t=ms&k=Stg&w1=Spare+time&w2=Craft+hobby&w3=Hob
        >
        by+and+craft+supply&w4=Home+electronics&w5=Marine+electronics&w6=Stg&c=6&s=1
        > 16&.sig=qbtEJ-0YjTZRhFcJRw_OfQ>
        >
        > _____
        >
        > YAHOO! GROUPS LINKS
        >
        >
        >
        > * Visit your group "sparetimegizmos
        > <http://groups.yahoo.com/group/sparetimegizmos> " on the web.
        >
        >
        > * To unsubscribe from this group, send an email to:
        > sparetimegizmos-unsubscribe@yahoogroups.com
        >
        <mailto:sparetimegizmos-unsubscribe@yahoogroups.com?subject=Unsubscribe>
        >
        >
        > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
        > <http://docs.yahoo.com/info/terms/> .
        >
        >
        > _____
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.