Author Topic: Petri Dish  (Read 5136 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Petri Dish
« on: October 02, 2021, 04:42:50 pm »
Hi everyone!

I made a nerdy little program that just grew in feature creep. I just made if for myself to see some 'Brownian Motion' plots. And then it just  started to grow! So now's it a full blown app with a GUI. It's still a nerdy program, but it has many features.

You can generate plots, save and load plot data to disk, change the colors that are used in a plot, and save a plot to a bmp. You can also bring up the 'Petri Dish walk through' html file from the program.

And last, but not least, you can change the color theme of the GUI in the source code. There's a   commented line that allows you to change a single number for a different GUI theme color. Yeah, I could have made it change colors by a single button press, but once you find the one you like best (or find the least objectionable), you probably won't change the color theme afterwards.






Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Petri Dish
« Reply #1 on: October 02, 2021, 06:33:20 pm »
Hi @AndyA

Nice to see you again. This reminds me of kelp from SdlBasic Forum I think.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Petri Dish
« Reply #2 on: October 02, 2021, 09:53:40 pm »
Hi bplus!

It Diffusion Limited Aggregation just like the kelp. This time it's a circular DLA. It's trickier to do the circular thing, but basically the same Brownian Motion behind the scenes. The thing I like is that it's very fast to complete compared to other languages. I first saw this years ago on Paul Bourke's web site, and even made my own, but it was slow and not optimized at all. Much better results this time.

I also made ports to JB, sdlBasic and BlitzPlus basic. Nearly identical UI's but vastly different results in speed. QB64 and BlitzPlus being the fastest versions.



Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Petri Dish
« Reply #3 on: October 03, 2021, 04:12:54 am »
Cool... Nice QB64 conversion...  Had to remove the dontwait from the shell command... Clicked walk through and it opened 2 walkthrough's... Even running with "512", QB64 version, is really fast... Nicely done!
Logic is the beginning of wisdom.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Petri Dish
« Reply #4 on: October 03, 2021, 12:02:52 pm »
Hi johnno56!

Thanks for the comment.

The double opening of the HTML is probably caused by QB64 being so fast in polling. QB64 processed the first click, and before you could release the mouse button, it processed another click. I think if you increase the delay time a small amount, it will eliminate opening two HTML's.

The QB64 version is tied as the fastest DLA generator I've ported.


Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Petri Dish
« Reply #5 on: October 03, 2021, 03:21:23 pm »
Yeah. It's a fast little beast... So much faster than sdlbasic... (imho) I hesitated in using the '_LIMIT' command as I like to see the program run as fast as possible... almost hypnotic... The one problem I did have, trying as hard as I could, I couldn't find any aliens to shoot... Mouse button and trigger finger just itching for action... Either they are well hidden or operating on an extremely long timer... Unless they were not programmed for 'this' version? Looking forward to the next... ;)

"Tied"? Logic dictates that you may be referring to BBC4W or BBCSDL. I have also found it faster than sdlbasic... Fascinating.
Logic is the beginning of wisdom.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Petri Dish
« Reply #6 on: October 03, 2021, 08:43:43 pm »
Hi johnno56.

You're trigger finger might have something to shoot at if the critters were larger.  As it is now, it's like shooting a 155mm Howitzer at a mosquito. Yes it will get the job done, it you can find/see the beastie.

As to the other software, it's good old (no longer developed) BlitzPlus basic. The only advantage that BlitzPlus still has over many other languages, are the built in GUI gadgets (buttons, list boxes, radio buttons, text boxes, etc) just like those seen in Windows apps. As noted, BlitzPlus basic is also very fast.

There's always JustBasic that has many GUI features, but is sooooo muuuuch slower. In the end it's more like an interpreter speed wise, vs a truly compiled language.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Petri Dish
« Reply #7 on: October 03, 2021, 09:03:30 pm »
Hi @AndyA.  I gave your program a whirl tonight.  It works/displays perfect on my Win7-32 bit PC.  Looked over the well done source.  Nice coding I think, clean and easy to follow.

- Dav

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Petri Dish
« Reply #8 on: October 03, 2021, 09:27:08 pm »
Hi Dav,

Thanks for the nice comment, glad it worked well for you.

I had too much fun working on that little program. I'm working my way up to using the GUI features in another program I'm working on.