Board Logo
« Text - Based Challenge »

Welcome Guest. Please Login or Register.
Feb 25th, 2018, 7:56pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1 ... 2 3 4 5  Notify Send Topic Print
 veryhotthread  Author  Topic: Text - Based Challenge  (Read 3171 times)
Akos
Junior Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 120
xx Re: Text - Based Challenge
« Reply #49 on: Aug 1st, 2008, 01:32am »

I put my entry to the files archive here:
http://jbusers.com/phpBB/viewtopic.php?t=1346

It's a very small program, actually it's only a symbolical way to take part in the contest. Besides, I didn't manage to make it without an external wav file. Sorry, I wanted to use a simple BEEP sound, but somehow it remained mute on my PC, no idea why...
User IP Logged

Joseph E.
Full Member
ImageImageImageImage


member is offline

Avatar

Hello.


PM

Gender: Male
Posts: 266
xx Re: Text - Based Challenge
« Reply #50 on: Aug 1st, 2008, 6:22pm »

Henry: Outstanding entry! Very enjoyable and fun...I haven't made it all the way around the world quite yet, though.

Akos: Very useful program. So far, it is the only non-game entry. I set it to go off 60 times an hour, and it faithfully rang the little bell every minute on the minute.

- Joseph smiley
User IP Logged

Want to know more? I have a list of pretty much everything I've ever done. Joseph's Personal LB Page
mylifedrive
Full Member
ImageImageImageImage


member is offline

Avatar

Encountering Errors


Homepage PM

Gender: Male
Posts: 179
xx Re: Text - Based Challenge
« Reply #51 on: Aug 1st, 2008, 10:08pm »

on Aug 1st, 2008, 01:32am, Akos wrote:
I wanted to use a simple BEEP sound, but somehow it remained mute on my PC, no idea why...


BEEP doesn't work for me either- Win XP SP1
User IP Logged

Just Basic is the BEST FREE BASIC AROUND!
Henry
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 757
xx Re: Text - Based Challenge
« Reply #52 on: Aug 2nd, 2008, 12:46am »

Just a few minutes before the deadline and thought i'd post this little program too.
It is a small utility to convert GW-BASIC source code. It's main purpose is to remove
the drudgery of figuring out which line numbers are not needed, and making JB-style
labels out of those we need to keep.
Code:
' Just BASIC program to remove line numbers from GW-BASIC
' source code.  It preserves the lines referenced by a
' GOTO, THEN, ELSE or GOSUB.
' It will also make them JB-style labels by putting [ and ]
' around them.  It will do the same to the calling line
' so that something like --
' 100 IF a=b THEN 250 ELSE 350
' becomes --
' IF a=b THEN GOTO [250] ELSE GOTO [350]

filedialog "Select BAS file", "*.*", myfile$
if myfile$="" then End
open myfile$ for input as #fin
open myfile$+".new" for output as #fout
n = 0
all$ = " "

  while eof(#fin)=0
    line input #fin, aline$
    if val(aline$)>0 then
      n = n + 1

      call xtracto aline$, "GOTO ", all$
      call xtracto aline$, "THEN ", all$
      call xtracto aline$, "ELSE ", all$
      call xtracto aline$, "GOSUB ", all$
 '     PRINT aline$
      print #fout, aline$

    end if
  wend
  close #fin
  close #fout

  print myfile$; " has "; n; " lines."
  print
  print "Length of all$ = "; len(all$); " characters."
  print all$

' now that we have an string with all the lines that need to be labeled
' we open our .new file, adding brackets to those lines needing
' them and removing the line numbers from those lines that don't.
  open myfile$+".new" for input as #fin
  while eof(#fin)=0
    line input #fin, aline$
    n = val(aline$)
    if n>0 then
      if instr(all$, " ";str$(n);" ", 1)>0 then
        print "["; str$(n); "]"; mid$(aline$, len(str$(n))+1)
      else
        print mid$(aline$, len(str$(n))+1)
      end if
    else
      print aline$  ' if no line #, print full line
    end if
  wend
  close #fin
  print
  print "Done."
End

sub xtracto byref ln$, s$, byref t$
  pos = instr(ln$, s$, 1)
  while pos>0
    g = val(trim$(mid$(ln$, pos+len(s$))))
    if g>0 then
      t$ = t$ + str$(g) + " "   ' save line number
' if you want to store each label once, replace the line above this
' comment with the line below.  I find it useful to know the number
' of times each label is called.
'      if instr(t$, " ";g$;" ", 1)=0 then t$ = t$ + str$(g)+" "

' add brackets for GOTOs and GOSUBs
' add GOTO + brackets for THENs and ELSEs.
      p2 = pos+len(s$)
      p3 = pos+len(s$)+len(str$(g))
      if left$(s$, 2)="GO" then
        ln$ = mid$(ln$, 1, p2-1); "["; mid$(ln$, p2, p3-p2); "]"; mid$(ln$, p3)
      else   ' for THEN or ELSE
        ln$ = mid$(ln$, 1, p2-1); "GOTO [" _
            + mid$(ln$, p2, len(str$(g))); "]" _
            + mid$(ln$, p3)
      end if
    end if
    pos = instr(ln$, s$, pos+len(s$))
  wend
end sub 


This program does not break a multi-command line into separate lines. One is here
at the JB conforum though... from Janet Terra.. posta couple years ago.
It does a very nice job of breaking them into single lines and all IF statements are
converted to blocks (IF -- THEN -- END IF)

I'm releasing this utility as public domain so if you'd like to alter / enhance / etc, go for it.
« Last Edit: Aug 2nd, 2008, 12:55am by Henry » User IP Logged

Henry
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 757
xx Re: Text - Based Challenge
« Reply #53 on: Aug 2nd, 2008, 12:53am »

on Aug 1st, 2008, 6:22pm, Joseph E. wrote:
Henry: Outstanding entry! Very enjoyable and fun...I haven't made it all the way around the world quite yet, though.

- Joseph smiley


Nor have I. Amelia make it about 27,000 miles before going down in the Marshall Islands. The best i've done so far is about 20,000 miles. The lack of an African airfield where a major overhaul is possible is making it really tough on the flight to India. Good luck!
User IP Logged

mylifedrive
Full Member
ImageImageImageImage


member is offline

Avatar

Encountering Errors


Homepage PM

Gender: Male
Posts: 179
xx Re: Text - Based Challenge
« Reply #54 on: Aug 2nd, 2008, 09:05am »

For most people now, the challenge is over! Let's bring on the voting!

grin
User IP Logged

Just Basic is the BEST FREE BASIC AROUND!
Joseph E.
Full Member
ImageImageImageImage


member is offline

Avatar

Hello.


PM

Gender: Male
Posts: 266
xx Re: Text - Based Challenge
« Reply #55 on: Aug 2nd, 2008, 11:13am »

on Aug 2nd, 2008, 12:46am, Henry wrote:
Just a few minutes before the deadline and thought i'd post this little program too.
It is a small utility to convert GW-BASIC source code. It's main purpose is to remove
the drudgery of figuring out which line numbers are not needed, and making JB-style
labels out of those we need to keep.


Wow, a cool little bonus! I went and snatched some GW basic code off the internet and tested your small and efficient program. For what it does, it works great.

Now...

The challenge is officially over! Voting should commence shortly.

- Joseph
User IP Logged

Want to know more? I have a list of pretty much everything I've ever done. Joseph's Personal LB Page
Joseph E.
Full Member
ImageImageImageImage


member is offline

Avatar

Hello.


PM

Gender: Male
Posts: 266
xx Re: Text - Based Challenge
« Reply #56 on: Aug 2nd, 2008, 11:50am »

I want to say thank you to everyone who participated, we had a total of eight entries!

Everyone did such an excellent job on their entry! Many, many, thanks to Janet for helping me coordinate this challenge, and to those who approved my contest while it was in planning.

Everyone made such a cool entry, that I don't know if I'll be able to vote! shocked Everyone has really made this a worthwhile contest, and I appreciate the effort that was put into this!

Here's some quick links to find each entry:

SirDavid - TEXTRIS

cundo - Pac-Main

mylifedrive - SPY Typist

tsh73 - Star Trek

Jeremy Howell - D-Day - Operation Overlord

Henry - Amelia Earhart: Around the World Flight

Akos - Time Reminder

Henry - GW-BASIC to JB Converter Utility

- Joseph smiley
User IP Logged

Want to know more? I have a list of pretty much everything I've ever done. Joseph's Personal LB Page
Henry
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 757
xx Re: Text - Based Challenge
« Reply #57 on: Aug 3rd, 2008, 02:18am »

Three cheers to Joseph E for doing a fine job hosting the challenge. Well done!

And good luck to all the entrants. smiley
« Last Edit: Aug 3rd, 2008, 02:19am by Henry » User IP Logged

jeremyhowell
Senior Member
ImageImageImageImageImage


member is offline

Avatar

A Life? Cool! Where can I download one of those from?


Homepage PM

Gender: Male
Posts: 874
xx Re: Text - Based Challenge
« Reply #58 on: Aug 3rd, 2008, 8:52pm »

Hip hip hooray!

Thanks Joseph E.
User IP Logged

The mods and admins are not paid to help you and run this forum, so give them the respect they deserve. wink

Free Games

AMD Athlon XP 2200+ 1.81Ghz, 512mb RAM, GeForce 7600 GS, Windows XP Home Edition SP3, Just BASIC 1.01
lay6
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: Text - Based Challenge
« Reply #59 on: May 7th, 2010, 9:09pm »

can the game be of adult content?
User IP Logged

jeremyhowell
Senior Member
ImageImageImageImageImage


member is offline

Avatar

A Life? Cool! Where can I download one of those from?


Homepage PM

Gender: Male
Posts: 874
xx Re: Text - Based Challenge
« Reply #60 on: May 7th, 2010, 9:36pm »

This closed like two tears ago. And if it was still open I think many of us would appreciate you not putting adult content in it. wink

~ Jeremy
User IP Logged

The mods and admins are not paid to help you and run this forum, so give them the respect they deserve. wink

Free Games

AMD Athlon XP 2200+ 1.81Ghz, 512mb RAM, GeForce 7600 GS, Windows XP Home Edition SP3, Just BASIC 1.01
tomc
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 590
xx Re: Text - Based Challenge
« Reply #61 on: Jul 16th, 2010, 12:02pm »

I hope to have my (casino) Craps Simulator ready prior to the deadline. I am including (1) pass/dont pass stats, (2) dice frequency, and (3) win/loss statements based on betting systems. If you have a favorite betting system you would like to be included, please let me know and I'll try to add it based on complexity. thanks !!
User IP Logged

tomc
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 590
xx Re: Text - Based Challenge
« Reply #62 on: Jul 16th, 2010, 12:04pm »

Sorry, I noted Aug but now see 2008. I'll post it in shared !
User IP Logged

Joseph E.
Full Member
ImageImageImageImage


member is offline

Avatar

Hello.


PM

Gender: Male
Posts: 266
xx Re: Text - Based Challenge
« Reply #63 on: Jul 16th, 2010, 12:07pm »

Haha, I had no idea this thing had these replies (definitely NO adult content! [see page 4 in case you're wondering...])

I've thought about hosting a second Text-Based challenge actually. But I just never got around to it.
User IP Logged

Want to know more? I have a list of pretty much everything I've ever done. Joseph's Personal LB Page
Pages: 1 ... 2 3 4 5  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls