LB Booster
« Winter fun 2016 Snow Scene »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:56am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Winter fun 2016 Snow Scene  (Read 480 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Winter fun 2016 Snow Scene
« Thread started on: Nov 9th, 2016, 9:34pm »

You can find my submission for this challenge at the Umbrella Forum - it works in JB, LB and LBB. I would appreciate it if somebody would cross-post it to the other forums because needless to say I'm not able to.

There are a few interesting features. Firstly it draws a different tree every time it is run, using a fractal algorithm with random terms; I think it's quite realistic. Secondly it contains a 'getpixel' function which works even in Just BASIC, by reading from a saved BMP file (not an original idea by any means, but I coded this one from scratch).

It provides a tough test for LBB's graphics, because it consists almost entirely of 'set' commands. What I'm finding here is that it runs at about the same speed as JB/LB when run on a CPU with a least two cores, but is actually somewhat slower if run on a single-core CPU (even if hyperthreaded).

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Winter fun 2016 Snow Scene
« Reply #1 on: Nov 10th, 2016, 08:33am »

on Nov 9th, 2016, 9:34pm, Richard Russell wrote:
You can find my submission for this challenge at the Umbrella Forum - it works in JB, LB and LBB.

Interestingly it showed up a bug in JB/LB that I haven't come across before, and which isn't documented at the Bug Tracker wiki. It appears that when JB/LB redraws graphics from a stored 'segment' (i.e. after a flush and when the window is minimized/maximized or covered/uncovered) it doesn't initialise the rule.

So if (for example) a rule xor command has later been issued, JB/LB will redraw the stored segment using that rule instead of the one in effect when the graphics were originally drawn! So rather than re-drawing them as they were, the graphics are drawn completely differently.

The workaround is to deliberately store a rule over command in the original segment. It won't have any effect on the graphics when they are initially drawn, but will cause them to be re-drawn correctly later, if required.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Winter fun 2016 Snow Scene
« Reply #2 on: Nov 10th, 2016, 1:25pm »

on Nov 9th, 2016, 9:34pm, Richard Russell wrote:
it draws a different tree every time it is run, using a fractal algorithm with random terms; I think it's quite realistic.

The trunk is perhaps a bit too slim, so if you like you can change the line in sub branch which sets the size as follows:

Code:
    #w "size ";int(1.4^depth);";line ";x1;" ";y1;" ";x2;" ";y2 

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls