Jump to content
IGNORED

IntyBASIC Seeding of random number generator


Recommended Posts

15 minutes ago, 5-11under said:

I used IntyBASIC. I just used a 16 but number, so I could catch the carry bit.

 

In this case, the game is for the current contest, so no assembly allowed. Otherwise I probably would have used your code.


Ah, I was assuming a 16-bit LSFR (I use a 32-bit one myself).  I suppose you can simulate a rotation on an 8-bit value by masking the 9h bit (the carry of an 8-bit operation in a 16-bit variable) and adding 1 to the value.

 

I would understand if you do not feel comfortable doing so, but would you mind sharing the source code so that others could learn from it?  This thread has grown into some sort of reference on various PRNG implementation options in IntyBASIC, and a short, effective one would be a great addition.:)

 

     dZ.

Link to comment
Share on other sites

18 minutes ago, DZ-Jay said:


Ah, I was assuming a 16-bit LSFR (I use a 32-bit one myself).  I suppose you can simulate a rotation on an 8-bit value by masking the 9h bit (the carry of an 8-bit operation in a 16-bit variable) and adding 1 to the value.

 

I would understand if you do not feel comfortable doing so, but would you mind sharing the source code so that others could learn from it?  This thread has grown into some sort of reference on various PRNG implementation options in IntyBASIC, and a short, effective one would be a great addition.:)

 

     dZ.

I'll upload it tonight. It's probably pretty crappy, but it functions fast enough.

  • Like 2
Link to comment
Share on other sites

1 minute ago, 5-11under said:

I'll upload it tonight. It's probably pretty crappy, but it functions fast enough.

 

Cool!  I'm sure it'll still be useful to others.

 

I'll also try to get motivated and port my assembly version to IntyBASIC.  It is not intended to be a "quick-and-dirty" PRNG, but a robust implementation of a maximal-length polynomial in the Galois field.  Originally part of my P-Machinery framework, I also intended it to serve as a replacement to RAND() in the IntyBASIC SDK because the distribution of generated numbers in IntyBASIC wasn't ideal.

 

Anyway, looking forward to seeing what you are working on ... I suppose it is for the IntyBASIC Tiny Contest?

 

     -dZ.

  • Like 1
Link to comment
Share on other sites

17 hours ago, carlsson said:

The link I posted before leads to a 100% IntyBASIC implementation, checked by Joe Z as well.

 

Ah.  Thank you.  I'll check that out.

 

My poor reading of your post left me with an impression that it was for the C64.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...