Some Animated Cloud Action, Improved Again!

Post your FreeBASIC tips and tricks here. Please don’t post your code without including an explanation.
badidea
Posts: 1891
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Some Animated Cloud Action, Improved Again!

Postby badidea » Jan 12, 2020 19:13

hurtado wrote:You nearly got it

I compared the non-windows version of mine and yours:
---
Line 23, my version:
dim shared as stPaleta miPaleta(0 to cdToColor)
Line 23, your version:
dim shared as stPaleta miPaleta(0 to cdToColor+1)

Are sure that is right? Freebasic allocates 1 memory location more the C (unfortunately).
So with cdToColor = 255, my version gives 256 elements (0...255), yours 257 (0...256).
---
Line 59, my version:
SetColorBase(x, y, Color)
Line 59, your version:
SetColorBase(x, y, color_)

That made the biggest difference. I should have done a 'search and replace'
---
Line 68, my version:
mBase(0) = int(rnd() * 226) + 1
Line 68, your version:
mBase(0) = int(rnd() * 255) + 1

That was a stupid typo. I would have never found that probably.
---
Now I will look at the algorithm itself. I did the conversion without trying to understand it...
hurtado
Posts: 47
Joined: Apr 26, 2017 8:57
Contact:

Re: Some Animated Cloud Action, Improved Again!

Postby hurtado » Jan 12, 2020 19:38

You could probably remove "+1"

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 3 guests