Search found 8216 matches

by dodicat
Jun 15, 2025 13:16
Forum: General
Topic: [missing feature] Is there a postfix for unsigned 16-bit hex values ?
Replies: 5
Views: 420

Re: [missing feature] Is there a postfix for unsigned 16-bit hex values ?

Tag on US and smell the coffee?

Code: Select all


#cmdline "-w none"

#define US and 65535u

print &H81234UL
print &H81234ULUS
print cushort(&H81234UL)
print cast(ushort,&H81234UL)

sleep 
 
by dodicat
Jun 14, 2025 11:04
Forum: Libraries Questions
Topic: Linked with external 64-bit Unicode C/C++ Visual Studio DLL
Replies: 28
Views: 2640

Re: Linked with external 64-bit Unicode C/C++ Visual Studio DLL

Here is how I include tooltips. Without using main and winproc e.t.c. (Works then of course also), I just use a simple gl window with buttons to demonstrate. #include "windows.bi" #Include once "/win/commctrl.bi" #include "fbgfx.bi" Screencontrol fb.SET_GL_2D_MODE ,fb.O...
by dodicat
Jun 12, 2025 10:19
Forum: Beginners
Topic: Calculating the size of a sprite sheet.
Replies: 8
Views: 696

Re: Calculating the size of a sprite sheet.

Here is a sprite sheet array: Sub getarray(a() As Long,lim As Long) Redim a(1 To lim) Dim As Long k=3 For n As Long=1 To lim If n>k*k Then k+=1 If n<=4 Then a(n)=2 Else If n<=k*k Then a(n)=k End If End If Next End Sub Redim As Long a() getarray(a(),102) Print "sprites","cols",&qu...
by dodicat
Jun 12, 2025 8:59
Forum: Libraries Questions
Topic: Linked with external 64-bit Unicode C/C++ Visual Studio DLL
Replies: 28
Views: 2640

Re: Linked with external 64-bit Unicode C/C++ Visual Studio DLL

No download problem here on win 11.
The download is sound, I have used fbfrog often enough, it was created by a former fb admin member called dkl.
I use Avast One antivirus, the free version of course, which is usually quite pernickety, but is happy with fbfrog.
by dodicat
Jun 11, 2025 9:23
Forum: Beginners
Topic: Calculating the size of a sprite sheet.
Replies: 8
Views: 696

Re: Calculating the size of a sprite sheet.

ceil is defined in crt.bi #include "crt.bi" print "sprites","cols","rows" for lcount as long =1 to 30 dim as long sh_col,sh_row If lcount =1 Then ''lcount = number of sprites sh_col = 2 ''columns sh_row = 2 ''rows Else sh_col = ceil(Sqr(lcount)) sh_row = sh_co...
by dodicat
May 31, 2025 8:55
Forum: Community Discussion
Topic: Bug?
Replies: 16
Views: 1982

Re: Bug?

If you use ulong, you get a warning.

Code: Select all

Screenres 800, 600
Dim a As Ulong
a = 1E10		' 1E9 does not crash

Print a

Line (0, 0) - (a, a)
Print Point(0),Point(1)
Sleep
 
by dodicat
May 29, 2025 18:57
Forum: Game Dev
Topic: Tic-Tac-Toe Game
Replies: 4
Views: 684

Re: Tic-Tac-Toe Game

Thanks syn9.
Commented like a maths person.
Nice neat game.
by dodicat
May 29, 2025 9:02
Forum: Game Dev
Topic: Tic-Tac-Toe Game
Replies: 4
Views: 684

Re: Tic-Tac-Toe Game

Here's a little tic-tac-toe game. Thanks to ImortisInglorian on the discord for some feedback on my rock-paper-scissors game, I was able to include some of that feedback here. It is maybe deliberate for you, but your function rand_range() does not hit the rhs limit. Here is a comparison showing hit...
by dodicat
May 28, 2025 20:27
Forum: Sources, Examples, Tips and Tricks
Topic: integer square root for BigNum
Replies: 24
Views: 2863

Re: integer square root for BigNum

Thanks srvaldez, that was easier.
by dodicat
May 28, 2025 20:02
Forum: Sources, Examples, Tips and Tricks
Topic: integer square root for BigNum
Replies: 24
Views: 2863

Re: integer square root for BigNum

There seems to be many files to download to test BigNum, one by one. i'll try later. In the meantime, a random number (rndx(num)) where num is the maximum and the random numbers fall between "0" and num. tested 10.20 also. #cmdline "-gen gcc -O 2" Namespace Big Sub split(stri As ...
by dodicat
May 25, 2025 19:28
Forum: Beginners
Topic: Test load save a File
Replies: 15
Views: 2193

Re: Test load save a File

This should work in fbide(bom added):  ' I am using here WinFBE editor for displaying the greek character in editor ' you must change ANSI to UTF-8 (BOM) first #define UNICODE #if defined( __FB_WIN32__ ) #include "windows.bi" ' only for messagebox #endif dim a as wstring * 16 a = "...
by dodicat
May 25, 2025 18:48
Forum: Beginners
Topic: Test load save a File
Replies: 15
Views: 2193

Re: Test load save a File

Thanks Löwenherz .
I had to put a utf bom at the head of a file

Code: Select all

 
to get

Code: Select all

922
Καλημέρα
 
The message box showed up OK also.
by dodicat
May 25, 2025 7:24
Forum: Sources, Examples, Tips and Tricks
Topic: integer square root for BigNum
Replies: 24
Views: 2863

Re: integer square root for BigNum

Thanks srvaldez.
I shall probably give fixed length strings the slip henceforth.
by dodicat
May 24, 2025 22:16
Forum: Sources, Examples, Tips and Tricks
Topic: integer square root for BigNum
Replies: 24
Views: 2863

Re: integer square root for BigNum

I have found the culprit

Code: Select all


sub dothis
    dim as string num
    dim as string * 1 sign
    for n as long=1 to 10
        num=sign+str(n)
        print "'";num;"'"
    next
end sub

dothis
sleep 
string * 1 is a space in 1.20, but a null string in fb 1.10
Why has it changed?
by dodicat
May 24, 2025 20:30
Forum: Sources, Examples, Tips and Tricks
Topic: integer square root for BigNum
Replies: 24
Views: 2863

Re: integer square root for BigNum

I had to send trim(num) to minus.

I don't yet know how spaces got into num in fb 1.20.
I'll look more closely into it.