• Baja Random Paragrphs

    From DesotoFireflite@VERT/VALHALLA to All on Sunday, January 12, 2014 03:12:15
    I know, baja is old school, but For now, that's what I am comfortable with. I know haw to build a progem using random lines or one liners, but how do I select random paragraphs (4 or 5 lines). Can it be done. I'm trying to make a quotes program for login. As always, thanks

    - Gates are down, the lights are flashing, but the train isn't coming.

    - C.G. Learn
    - Valhalla Home Services! - Telnet://valhalla.synchro.net
    - A Gamers Paradise - Over 100 Registered Online Game Doors!


    ---
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From Mro@VERT/BBSESINF to DesotoFireflite on Sunday, January 12, 2014 09:00:20
    Re: Baja Random Paragrphs
    By: DesotoFireflite to All on Sun Jan 12 2014 03:12 am

    I know, baja is old school, but For now, that's what I am comfortable with. I know haw to build a progem using random lines or one liners, but how do I select random paragraphs (4 or 5 lines). Can it be done. I'm trying to make a quotes program for login. As always, thanks



    the best way to do that is to have each multiple line quote written to a separate file. otherwise, if you want it to be in one single file, you need to follow some type of standard where each quote is exactly a certain amount of lines, or you use some type of marker within the file to keep track of where you are and where you're going. it would get very complicated.
    that's the only way i can think of doing it, but i'm sure there's another way.

    if you dont want to devote a ton of time to it, i would go with having each quote in a separate file.
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
  • From Poindexter Fortran@VERT/REALITY to Mro on Sunday, January 12, 2014 07:58:14
    Re: Baja Random Paragrphs
    By: Mro to DesotoFireflite on Sun Jan 12 2014 09:00 am

    the best way to do that is to have each multiple line quote written to a separate file. otherwise, if you want it to be in one single file, you need to follow some type of standard where each quote is exactly a certain amount of lines, or you use some type of marker within the file to keep track of where you are and where you're going.

    I'm using that same scenarios as an excuse to learn more javascript. I have the Oblique Strategies deck displayed one line at a time on menus, and broke the files into separate files. I'd like to set a variable N to the # of lines in a single file, cast a random number between 1 and N, and read that line instead.

    ---
    þ Synchronet þ realitycheckBBS -- http://realitycheckBBS.org
  • From mark lewis@VERT to DesotoFireflite on Sunday, January 12, 2014 11:37:22
    On Sun, 12 Jan 2014, DesotoFireflite wrote to All:

    I know, baja is old school, but For now, that's what I am
    comfortable with. I know haw to build a progem using random lines or
    one liners, but how do I select random paragraphs (4 or 5 lines).
    Can it be done. I'm trying to make a quotes program for login. As
    always, thanks

    the quotes programs i've seen generally use a '%' on a blank line between each section... they generate an index based on the line number of each '%' and then
    choose which section to post by choosing a random number in the range of the index count... then the index for that section tells what line to start reading
    from... the code simply reads until it runs into the next '%' or the end of the
    file... OR one might subtract the line to start at from that of the next section to get a number of lines to read...

    eg:
    %
    line 1
    line 2
    line 3
    %
    another line 1
    another line 2
    %
    foo line
    bar line
    foobar line
    furby line


    the above is indented for clarity... the '%' are flush left and the other lines
    may be offset and preformatted if desired...

    i have code for this written in either php or perl... it is in use on my website and is what presents the random quote in the blue box on my main page... it chooses a quote from a number of quote files or i can set it to choose quotes from only one file... it is fashioned after the "fortune" program
    on *nix systems...

    http://www.wpusa.dynip.com/

    for an example... simply refresh the page to get a new quote... there's over 10000 IIRC and more are easily added ;)

    )\/(ark

    Not only is the Universe stranger than we think, it is stranger than we can think. - Werner Heisenberg

    --- FMail/Win32 1.60
    * Origin: (1:3634/12.71)
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From KF5QEO@VERT/MAINLINE to DesotoFireflite on Sunday, January 12, 2014 12:22:17
    Re: Baja Random Paragrphs
    By: DesotoFireflite to All on Sun Jan 12 2014 03:12:15

    I know, baja is old school, but For now, that's what I am comfortable
    Here's a thought, why not someone write a BAJA 2 JAVASCRIPT converter program.

    ---
    þ Synchronet þ Roach Guts -- kingcoder.net
  • From Mro@VERT/BBSESINF to KF5QEO on Sunday, January 12, 2014 16:46:25
    Re: Baja Random Paragrphs
    By: KF5QEO to DesotoFireflite on Sun Jan 12 2014 12:22 pm

    Re: Baja Random Paragrphs
    By: DesotoFireflite to All on Sun Jan 12 2014 03:12:15

    I know, baja is old school, but For now, that's what I am comfortable
    Here's a thought, why not someone write a BAJA 2 JAVASCRIPT converter program.


    well you can still use baja and you can still execute baja from .js
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
  • From DesotoFireflite@VERT/VALHALLA to Mro on Sunday, January 12, 2014 17:39:04
    Re: Baja Random Paragrphs
    By: Mro to DesotoFireflite on Sun Jan 12 2014 09:00 am

    the best way to do that is to have each multiple line quote written to a separate file. otherwise, if you want it to be in one single file, you need to follow some type of standard where each quote is exactly a certain amount of lines, or you use some type of marker within the file to keep track of where you are and where you're going. it would get very complicated. that's the only way i can think of doing it, but i'm sure there's another way.

    if you dont want to devote a ton of time to it, i would go with having each quote in a separate file.

    I was thinking about that actually, but wondered if there was another way. Thanks for the reply:)

    - CAT (n.), Furry keyboard cover.

    - C.G. Learn
    - Valhalla Home Services! - Telnet://valhalla.synchro.net
    - A Gamers Paradise - Over 100 Registered Online Game Doors!


    ---
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From DesotoFireflite@VERT/VALHALLA to mark lewis on Sunday, January 12, 2014 17:44:13
    Re: Baja Random Paragrphs
    By: mark lewis to DesotoFireflite on Sun Jan 12 2014 11:37 am

    the quotes programs i've seen generally use a '%' on a blank line
    between each section... they generate an index based on the line number
    of each '%' and then choose which section to post by choosing a random number in the range of the index count... then the index for that
    i have code for this written in either php or perl... it is in use on my

    I'm just learning Baja, so this may be a very stupid question, but you mentioned php and perl, are they anything like baja codeing wise?

    - CAT (n.), Furry keyboard cover.

    - C.G. Learn
    - Valhalla Home Services! - Telnet://valhalla.synchro.net
    - A Gamers Paradise - Over 100 Registered Online Game Doors!


    ---
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From mark lewis@VERT to DesotoFireflite on Sunday, January 12, 2014 19:42:19
    On Sun, 12 Jan 2014, DesotoFireflite wrote to mark lewis:

    the quotes programs i've seen generally use a '%' on a blank line
    between each section... they generate an index based on the line
    number of each '%' and then choose which section to post by
    choosing a random number in the range of the index count... then
    the index for that i have code for this written in either php or
    perl... it is in use on my [...]

    I'm just learning Baja, so this may be a very stupid question, but
    you mentioned php and perl, are they anything like baja codeing
    wise?

    not sure how to answer that... many languages are similar to C or Pascal or similar... they're not too hard to read and figure out for the most part... i've not done anything in baja but i have done some javascript and they're very
    close... i can make my code available to you so you can see what it does and maybe either convert it to baja or use it for ideas on how to perform your task
    in baja...

    contact me privately if you are interested ;)

    )\/(ark

    Not only is the Universe stranger than we think, it is stranger than we can think. - Werner Heisenberg

    --- FMail/Win32 1.60
    * Origin: (1:3634/12.71)
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Mro@VERT/BBSESINF to DesotoFireflite on Sunday, January 12, 2014 21:32:22
    Re: Baja Random Paragrphs
    By: DesotoFireflite to Mro on Sun Jan 12 2014 05:39 pm

    I was thinking about that actually, but wondered if there was another way. Thanks for the reply:)


    i think having them in separate files is the easiest way in many ways.
    also makes it easy to make it random.
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
  • From DesotoFireflite@VERT/VALHALLA to mark lewis on Tuesday, January 14, 2014 03:42:58
    Re: Baja Random Paragrphs
    By: mark lewis to DesotoFireflite on Sun Jan 12 2014 07:42 pm

    contact me privately if you are interested ;)

    Tks

    - CAT (n.), Furry keyboard cover.

    - C.G. Learn
    - Valhalla Home Services! - Telnet://valhalla.synchro.net
    - A Gamers Paradise - Over 100 Registered Online Game Doors!


    ---
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net