Search found 624 matches

by UEZ
Oct 23, 2020 14:41
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 9
Views: 399

Re: [solved] Simple math question ?

Try this:

Dim As Ulong x, n = 15
x = (n * (n - 1) ) / 2
? x, Sqr((2 * x) + 0.25) + 0.5 = n
Sleep


If you look at the equation mathematically, then it has 2 solutions, because the function is a polynomial of second degree.
by UEZ
Oct 23, 2020 10:15
Forum: Libraries
Topic: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)
Replies: 18
Views: 519

Re: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)

@Joshy: is a possible to have only as small as possible DLL which plays SID files only? I'm using TitchySID.dlll (16 kb) which supports only x86 code execution.

Thanks. :-)
by UEZ
Oct 21, 2020 19:27
Forum: Tips and Tricks
Topic: The beauty / magic of math (21 examples)
Replies: 9
Views: 506

Re: The beauty / magic of math

Very nice. With river2 all I got was large squares appearing and disappearing. It didn't look like the JS version. flame failed to compile, Command executed: "C:\FreeBasic\fbc.exe" "C:\FreeBasic\UEZ\flame.bas" Compiler output: C:\FreeBasic\UEZ\flame.asm: Assembler messages: C:\F...
by UEZ
Oct 21, 2020 8:54
Forum: Libraries
Topic: fbsound 1.2 Windows/Linux (sid wav mp3 ogg mod it xm s3m)
Replies: 18
Views: 519

Re: preview: of fbsound 1.2 (dynamic) Windows/Linuxt (sid wav mp3 ogg mod it xm s3m)

Cool, I just tested it playing a SID file and works properly.

Thanks for sharing. :-)
by UEZ
Oct 20, 2020 20:22
Forum: Tips and Tricks
Topic: The beauty / magic of math (21 examples)
Replies: 9
Views: 506

Re: The beauty / magic of math

Tourist Trap wrote:Banana is math :)


Not only the banana is math ;-)
by UEZ
Oct 20, 2020 12:02
Forum: Tips and Tricks
Topic: The beauty / magic of math (21 examples)
Replies: 9
Views: 506

The beauty / magic of math (21 examples)

Here some examples which I converted from JS to FB from different coders using math. Raytracing: https://i.ibb.co/tCXDWRD/Raytracing.jpg 'Ported from https://www.dwitter.net/d/18413 by pavel to FB by UEZ build 2020-10-24 #Include "fbgfx.bi" Using FB #Define is_INF(__CHECKME__) (Cast(Intege...
by UEZ
Oct 19, 2020 20:52
Forum: Beginners
Topic: Path set with Setenviron() is temporary?
Replies: 4
Views: 213

Re: Path set with Setenviron() is temporary?

srvaldez wrote:@UEZ
when I click on that link it does not go where you intended, somehow the link is cropped at ).aspx
perhaps this link will work https://docs.microsoft.com/en-us/window ... dfrom=MSDN


Indeed, the link was corrupted - fixed.
by UEZ
Oct 18, 2020 13:36
Forum: Beginners
Topic: Path set with Setenviron() is temporary?
Replies: 4
Views: 213

Re: Path set with Setenviron() is temporary?

You can use the registry to set the path

For user: HKEY_CURRENT_USER\Environment\Path
System: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path


Have a look here how to read / write to the registry: Registry Functions
by UEZ
Oct 15, 2020 6:40
Forum: Tips and Tricks
Topic: Poisson disk sampling
Replies: 3
Views: 238

Re: Poisson disk sampling

Very interesting stuff - thanks for sharing.
by UEZ
Oct 14, 2020 12:22
Forum: Tips and Tricks
Topic: 3D animated Christmas Tree Intro build 2020-10-13
Replies: 0
Views: 218

3D animated Christmas Tree Intro build 2020-10-13

I know it is still too early, but here is a little "Merry Christmas" intro which can let be run on Christmas or earlier. ;-) https://i.ibb.co/mD1xmp7/Merry-Christmas.jpg Source code, needed files and compiled exe can be downloaded here: FB Merry Christmas build 2020-10-13.zip I don't know ...
by UEZ
Sep 28, 2020 13:45
Forum: Windows
Topic: Simple template with menu, edit control, listbox and statusbar
Replies: 11
Views: 301

Re: Simple template with menu, edit control, listbox and statusbar

This is a basic (pun intended) 99-lines template to be used for Windows GUI applications: #Include "windows.bi" ' JJ 28.9.2020 - a WinGUI template in less than 100 lines #Include "win\commctrl.bi" ' for CreateStatusWindow Dim Shared as Handle hEdit, hList, hStatus ' bat@TinyFB.b...
by UEZ
Sep 25, 2020 14:04
Forum: Community Discussion
Topic: [solved] if x2+y2 <= 1 then z2=1-(x2+y2) : z=sqr(z2) ?
Replies: 10
Views: 379

Re: if x2+y2 <= 1 then z2=1-(x2+y2) : z=sqr(z2) ?

Here the result using inverse square root: 'https://codegolf.stackexchange.com/questions/85555/the-fastest-square-root-calculator -> C (miles) Function _Sqrt4(n As Single) As Single 'Fast inverse square root -> https://en.wikipedia.org/wiki/Fast_inverse_square_root n = 1 / n Dim As ULong i Dim As Si...
by UEZ
Sep 24, 2020 9:24
Forum: Windows
Topic: Unwanted closing of console
Replies: 3
Views: 151

Re: Unwanted closing of console

Sometimes you don't want to pause but pause for x seconds only. Here the code I'm using for this purpose: Dim As String sVer = "v0.60 Build 2020-09-24 by UEZ" Dim As Double iSeconds = CSng(Command(1)) Dim As Ubyte bInterruptible, bSilent If Command(2) = "" Then bInterruptible = 1...
by UEZ
Sep 23, 2020 17:09
Forum: Tips and Tricks
Topic: Around the Sphere build 2020-09-22
Replies: 24
Views: 915

Re: Around the Sphere build 2020-09-22

File encoding needs to be ISO-8859-1, not UTF-8. Or at least, when I set that in Geany, it works. And fTimer should to be double. I can vague remember that we had this discussion already some times ago because of Base128 en-/decoding issues. Yes, here: Twister Effect build 2020-04-15 Well, on the o...
by UEZ
Sep 23, 2020 6:48
Forum: Tips and Tricks
Topic: Around the Sphere build 2020-09-22
Replies: 24
Views: 915

Re: Around the Sphere build 2020-09-22

File encoding needs to be ISO-8859-1, not UTF-8. Or at least, when I set that in Geany, it works. And fTimer should to be double. I can vague remember that we had this discussion already some times ago because of Base128 en-/decoding issues. Yes, it works for me too. Good to read. ;-) I cannot get ...

Go to advanced search