The beauty / magic of math (Vol. 1 - 19 build 2023-05-01)

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

Added volumes 8-12 (see 1st post for download link).

I think 12 volumes with 500 examples are enough for now.

Happy watching.
Last edited by UEZ on Jan 03, 2022 10:46, edited 2 times in total.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by dafhi »

zip file missing vol 5 and 12

other:
hit ESC it keeps running
Vol 11 - 3d pipes, Animated Curved Blue, Blue pattern
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

dafhi wrote:zip file missing vol 5 and 12
Indeed, vol. 5 was missing but not vol. 12. I uploaded the 7-Zip archive once again. Now it should contain all 12 volumes. I packed it with 7-Zip v21.07.
dafhi wrote: other:
hit ESC it keeps running
Vol 11 - 3d pipes, Animated Curved Blue, Blue pattern
Hmmm, for me it works properly when pressing ESC the program terminates as expected. Can you recompile and test it if it works then for you? All files were compiled in my Win7 VM using "-s gui -gen gcc -Wc -Ofast". Some of the examples must be compiled as x64.

Thanks for your feedback. :-)
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by srvaldez »

Hi UEZ :-)
very nice indeed, however in some demo's you need to change Integer to Long to make it 64-bit compatible
so far the places that I found that need the change is the line Dim As Integer imgData, pitch
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

srvaldez wrote:Hi UEZ :-)
very nice indeed, however in some demo's you need to change Integer to Long to make it 64-bit compatible
so far the places that I found that need the change is the line Dim As Integer imgData, pitch
Thanks srvaldez for the hint. This is a relict from the older FB version where Integer was ok. Updated the archive.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by dafhi »

UEZ - thank you for your efforts! i downloaded the new file, the 2 precompiled exes i tested close properly
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

The reason why Vol. 5 was missing is that I renamed the roman numbers and skipped Vol. 5 by a mistake.

In the old archive Vol. 5 and Vol. 10 are equal. I uploaded a new version with corrected volume numbers and a few Vol. 12 examples.

¯\_(ツ)_/¯
Last edited by UEZ on Jan 05, 2022 22:12, edited 1 time in total.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by dodicat »

Keep your admin on track UEZ:

Code: Select all

function intToRoman(num as longint) as string
    dim as string m(...) = { "", "M", "MM", "MMM" }
    dim as string c(...) = { "",  "C",  "CC",  "CCC",  "CD", _
                            "D", "DC", "DCC", "DCCC", "CM" }
    dim as string x(...) = { "",  "X",  "XX",  "XXX",  "XL", _
                            "L", "LX", "LXX", "LXXX", "XC" }
    dim as string i(...) = { "",  "I",  "II",  "III",  "IV", _
                            "V", "VI", "VII", "VIII", "IX" }
    dim as string thousands = m(num \ 1000)
    dim as string hundreds = c((num mod 1000) \ 100)
    dim as string tens = x((num mod  100) \ 10)
    dim as string ones = i(num mod 10)
    dim as string ans = thousands + hundreds + tens + ones
    return ans
end function


for n as long=1 to 465
print n,intToRoman(n)
next
sleep
 
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

dodicat wrote:Keep your admin on track UEZ:

Code: Select all

function intToRoman(num as longint) as string
    dim as string m(...) = { "", "M", "MM", "MMM" }
    dim as string c(...) = { "",  "C",  "CC",  "CCC",  "CD", _
                            "D", "DC", "DCC", "DCCC", "CM" }
    dim as string x(...) = { "",  "X",  "XX",  "XXX",  "XL", _
                            "L", "LX", "LXX", "LXXX", "XC" }
    dim as string i(...) = { "",  "I",  "II",  "III",  "IV", _
                            "V", "VI", "VII", "VIII", "IX" }
    dim as string thousands = m(num \ 1000)
    dim as string hundreds = c((num mod 1000) \ 100)
    dim as string tens = x((num mod  100) \ 10)
    dim as string ones = i(num mod 10)
    dim as string ans = thousands + hundreds + tens + ones
    return ans
end function


for n as long=1 to 465
print n,intToRoman(n)
next
sleep
 
Thanks dodicat for the roman number converter. At the beginning I started with roman numbers for an unknown reason and thought that the number of volumes will stay small but after some more volumes the sorting of the folder names in explorer view was confusing me and thus I decided to rename the numbers.
:-)
Iczer
Posts: 99
Joined: Jul 04, 2017 18:09

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by Iczer »

Sounds interesting! Thanks!
As side note - is there a possibility to transform it to transparent windowless kind of animated splash-screen with counter/progress bar to show at main program start/busy times? It would be great to have something this beautiful...
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 12)

Post by UEZ »

Iczer wrote:Sounds interesting! Thanks!
As side note - is there a possibility to transform it to transparent windowless kind of animated splash-screen with counter/progress bar to show at main program start/busy times? It would be great to have something this beautiful...
Hi Iczer,

I don't know what you mean. Can you please explain it more precise?
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (28 examples) Vol. II (Vol. 1 - 19 build 2023-05-01)

Post by UEZ »

Added many more examples from dwitter.net -> ~802 examples now and 19 volumes in sum.

Have a look to the first post for download link.

The executable files can cause false positive alarms in lame AV apps.
dafhi
Posts: 1641
Joined: Jun 04, 2005 9:51

Re: The beauty / magic of math (Vol. 1 - 19 build 2023-05-01)

Post by dafhi »

folders is a good idea, but not a folder every exe & bas

also, i'm on linux :D
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: The beauty / magic of math (Vol. 1 - 19 build 2023-05-01)

Post by UEZ »

Imho, with the folders it is more structured and clearer but feel free to change it on your system. :wink:

I'm on Windows only. :P
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: The beauty / magic of math (Vol. 1 - 19 build 2023-05-01)

Post by Luxan »

A little presumptuous of me.

Might you be able to help me with some mathematics.

Mostly sorted, just a fiddly bit , relates to DFT and CFT .
Post Reply