Search found 5779 matches

by dodicat
Jul 16, 2019 22:17
Forum: Game Dev
Topic: Physics question
Replies: 9
Views: 166

Re: Physics question

By the way D.J.Peters I forgot to thank you for speeding up my image rotate.
I used my old rotate here, but I may use the speeded up version in future.
by dodicat
Jul 16, 2019 20:03
Forum: Game Dev
Topic: Physics question
Replies: 9
Views: 166

Re: Physics question

Thought I would give this a try. Every impulse depends on the weight of the mouse. The resultant motion depends only on the given internal angle. Type pt As Single x,y,z End Type Operator -(p1 As pt,p2 As pt) As pt Return Type(p1.x-p2.x,p1.y-p2.y) End Operator Operator +(p1 As pt,p2 As pt) As pt Ret...
by dodicat
Jul 16, 2019 12:42
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 540

Re: For fbide users

Thanks deltarho. I just wanted to keep things simple, (within about 100 lines of visible code) Anyway, using my inputbox (for adding compiler options as you have mentioned). And because fbide is unable to accept upper case compiler options. And because srvaldez has been discussing opening a window r...
by dodicat
Jul 16, 2019 10:34
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 540

Re: InputBox() in console program

For an easy theme (one liner) you can do: #Include Once "windows.bi" Declare Function SetWindowTheme Lib "UxTheme.dll" Alias "SetWindowTheme"(As Any Ptr,As zstring Ptr,As zstring Ptr) As Long Sub box(textmessage As zstring) Static As HWND MessageWindow,EditBox,save,canc...
by dodicat
Jul 16, 2019 0:36
Forum: General
Topic: Squares
Replies: 6703
Views: 382298

Re: Squares

Albert
It is quite hard to follow.
You output chrs, but you have only done
chrs = mid(chrs,2)
Everything else in the decompress seems not to alter chrs.
by dodicat
Jul 15, 2019 18:06
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 540

Re: InputBox() in console program

How does your dialog box work marpon? When I run I get a five second console with closed and wait five seconds. I used -s console Must I run the resource bit with an .ico file? srvaldez a simple console box #Include Once "windows.bi" Sub box(textmessage As zstring) Static As HWND MessageWi...
by dodicat
Jul 15, 2019 13:22
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 540

Re: InputBox() in console program

I am a bit green with dialog stuff in winapi, but rolling out a custom message box is an alternative perhaps ? #Include Once "windows.bi" #Include once "/win/commctrl.bi" ' Globals (unavoidable) Dim Shared As zString * 255 textMessage="start" Dim Shared As HWND MainWind...
by dodicat
Jul 15, 2019 11:34
Forum: Community Discussion
Topic: New array features
Replies: 106
Views: 4870

Re: New array features

In pascal you can do this for fixed length arrays, but not for dynamic arrays (which always start at element[0] thus can be regarded as pointers) So in pascal for dynamic arrays, the result is as memcpy. Also I notice in python (lists) that it seems to be a pointer copy also. a=[1,2,3] b=a b[1]=5 pr...
by dodicat
Jul 13, 2019 9:55
Forum: General
Topic: Squares
Replies: 6703
Views: 382298

Re: Squares

Kinda reminds me of the Chinese remainder. Function HCF(a As Integer, b As Integer) As Integer If b=0 Then Return a Else Return HCF(b,a Mod b) End Function Function TestPairwiseCoprime(array() As Integer) As Integer For p1 As Integer = Lbound(array) To Ubound(array) - 1 For p2 As Integer = p1 + 1 To...
by dodicat
Jul 12, 2019 22:26
Forum: Windows
Topic: file requester for console program
Replies: 30
Views: 382

Re: file requester for console program

Yea-well, escape sequences look good but I prefer to write out each character, although it looks messy. Look up escape in the help file. escape sequences help. _\a beep _\b backspace _\f formfeed _\l or \n newline _\r carriage return _\t tab _\unnnn unicode char in hex _\v vertical tab _\nnn ascii c...
by dodicat
Jul 12, 2019 22:07
Forum: General
Topic: Squares
Replies: 6703
Views: 382298

Re: Squares

It is returning n because the faulty macro is calculating this.

Code: Select all

 
do
 dim as long n = int( rnd * 65536 )
 print n,(n mod 256) or 8192*n\8192 'is calculated in macro
 sleep
 loop until inkey=chr(27)

Or thereabouts.
by dodicat
Jul 12, 2019 22:03
Forum: Windows
Topic: file requester for console program
Replies: 30
Views: 382

Re: file requester for console program

You can list the filter. #define WIN_INCLUDEALL #Include Once "windows.bi" #Include once "/win/commctrl.bi" 'shell ("chcp 65001") 'failed attempt at getting console to print unicode names function getfiles(filetypes As String) as string Dim As zstring * 2048 SELFILE Dim...
by dodicat
Jul 12, 2019 21:26
Forum: General
Topic: Squares
Replies: 6703
Views: 382298

Re: Squares

A correct macro form is
#define join(a,b) (a) or 8192*(b)
It gives an unwanted answer, but the macro is correctly worked out for all a and b whether join(n mod 256 , n \ 8192 ) or join( v1,v2 )
by dodicat
Jul 12, 2019 18:52
Forum: General
Topic: Squares
Replies: 6703
Views: 382298

Re: Squares

Exactly Albert.
The macro should be
#define join(a,b) (a) or (8192*(b))
where the parameters are in brackets.
otherwise sending n \ 8192 to the macro means it is calculating (n mod 256) or 8192*n\8192 in the macro, instead of (n mod 256) or (8192*(n\8192))
when brackets are in place.
by dodicat
Jul 12, 2019 16:52
Forum: Game Dev
Topic: Mouse trouble
Replies: 3
Views: 117

Re: Mouse trouble

See screenevent in the help file. Quick example #include "fbgfx.bi" using fb dim as event e dim as long mx,my,mb,mouse,lastmb screen 19 do getmouse (mx,my,,mb) If (ScreenEvent(@e)) Then cls locate 5 if e.type=EVENT_MOUSE_BUTTON_PRESS and mb=1 then print "left pressed" if e.type=E...

Go to advanced search