Search found 7066 matches

by D.J.Peters
Nov 16, 2018 13:42
Forum: General
Topic: raytrace try
Replies: 23
Views: 1044

Re: raytrace try

Nice simplex noise textures.

Joshy
by D.J.Peters
Nov 16, 2018 2:35
Forum: Tips and Tricks
Topic: Function roots by bisection.
Replies: 6
Views: 132

Re: Function roots by bisection.

Four years ago I wrote an easy to understand expression parser and math solver. https://www.freebasic.net/forum/viewtopic.php?f=7&t=16664 I added set/get var and the assignment operator to day. ' ' main ' screenres 640,480 color 0,7 : cls var fn = "Sin(x^2)^2/x - Exp(x) + Cos(3*x) + 2*x*sin...
by D.J.Peters
Nov 16, 2018 2:31
Forum: Tips and Tricks
Topic: Another easy to understand expression solver.
Replies: 34
Views: 6166

Re: Another easy to understand expression solver.

Added set/get var and added the assignment operator see first post. Joshy ' ' copy the code from first post here ' screenres 640,480 color 0,7 : cls var fn = "Sin(x^2)^2/x - Exp(x) + Cos(3*x) + 2*x*sin(x) + 1" var minX = -6.0 , maxX = 2.0, xRange = maxX - minX var minY = -10.0, maxY = 6.0,...
by D.J.Peters
Nov 15, 2018 20:29
Forum: Tips and Tricks
Topic: Function roots by bisection.
Replies: 6
Views: 132

Re: Function roots by bisection.

A compile time function plotter has nothing to do with a run time f(x) solver.

You know expression parsing range checking ...

var f = "Sin(x^2)^2/x-Exp(x)+Cos(3*x)+2*x*sin(x)"

Plot( f, +1 , -6,2 )

How ever your code is simple and clean good job.

Joshy
by D.J.Peters
Nov 15, 2018 20:13
Forum: Libraries
Topic: FLTK C for FreeBASIC Jan 09, 2017
Replies: 171
Views: 21911

Re: FLTK C for FreeBASIC Jan 09, 2017

Reminds me on good old Visual Basic 4/5/6 days :-=) type Control extends object type Button extends Control ... type Container extends Control type Listbox extends Container type Toolbar extends Container ... type Form extends Container Joshy How easy is that: #include once "fltk-addon.bi"...
by D.J.Peters
Nov 14, 2018 7:24
Forum: Libraries
Topic: FLTK C for FreeBASIC Jan 09, 2017
Replies: 171
Views: 21911

Re: FLTK C for FreeBASIC Jan 09, 2017

I'm working in my rare spare time on a new FLTK add on. May be my next Christmas gift for you. It becomes easier than ever before :-) Joshy http://shiny3d.de/public/libs/fltk-c/addon.png Old C style: #include once "fltk-c.bi" sub ButtonClick cdecl (byval button as FL_WIDGET ptr, byval arg ...
by D.J.Peters
Nov 06, 2018 1:24
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 203

Re: How to grab escape-sequence keycodes?

If you read from stdin you use

Open Cons For Input As #hFile

then my posted solution will work

if not why

you can post the code also

Joshy
by D.J.Peters
Nov 06, 2018 0:58
Forum: General
Topic: Russian Sorting Halves Danilin
Replies: 11
Views: 268

Re: Russian Sorting Halves Danilin

I would name it split sort :-) (see function arraySplit) Joshy 'function arraySplit(outArray() as integer, _ inArray() as integer, _ startIndex as integer, _ lastIndex as integer,_ iDiv as integer) as integer dim as integer splitPoint FOR i as integer=startIndex TO lastIndex splitPoint += inArray(i)...
by D.J.Peters
Nov 05, 2018 23:45
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 203

Re: How to grab escape-sequence keycodes?

var hFile = FreeFile() Open Cons For Input As #hFile var aborted=false while aborted = false var ASingleChar = Input(1,hFile) if ASingleChar<>"" then if ASingleChar[0] = 1 then var TwoChars = Input(2,hFile) if TwoChars[0]=64 andalso TwoChars[1]=13 then print "F1 are pressed !" e...
by D.J.Peters
Nov 05, 2018 23:24
Forum: General
Topic: Russian Sorting Halves Danilin
Replies: 11
Views: 268

Re: Russian Sorting Halves Danilin

'RUSSIAN sorting halves 4 part bubble RANDOMIZE TIMER const as integer N = 17539 DIM as integer d(1 to N), a(1 to N), v(1 to N), q(1 to 5) FOR i as integer =1 TO N d(i)=INT(RND * N) NEXT print "DA RUS 4 start" dim as double start=TIMER dim as integer summa FOR i as integer=1 TO N summa +=...
by D.J.Peters
Nov 05, 2018 22:35
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 203

Re: How to grab escape-sequence keycodes?

"... Inkey, Getkey, and Multikey ..."

What have this functions to do with a RS-232 connection ?

In FreeBASIC a RS-232 connection is like a file read / write operation.

/wiki/KeyPgOpenCom

Joshy
by D.J.Peters
Nov 04, 2018 22:28
Forum: General
Topic: Illegal non-static member access
Replies: 16
Views: 240

Re: Illegal non-static member access

Code: Select all

type tEventHandler as sub()
type TMenu : as tEventHandler clickhandler : end type
type TForm : as TMenu menu : end type
sub MenuItemClick()
   print "menu item 1"
end sub
dim as TForm myForm
myForm.menu.clickhandler = @MenuItemClick
sleep
by D.J.Peters
Nov 04, 2018 21:47
Forum: General
Topic: SUB pointer and optional single ANY PTR parameter
Replies: 9
Views: 143

Re: Procedure pointer and optional ANY PTR parameter

@fxm it's a tiny bug but a bug is a bug :-) The lexer has a problem if the only param are of type "any" and has a default value of "NULL" Joshy Type TANY As any ptr Sub test (byval first as integer=0, Byval second As TANY=0) End Sub test():test(1):test(,0):test(1,0) Dim As Sub (b...
by D.J.Peters
Nov 04, 2018 13:02
Forum: DOS
Topic: Custom C64 eumlator crashes in FreeDOS
Replies: 10
Views: 258

Re: Custom C64 eumlator crashes in FreeDOS

Why do you allocate 560 MB ?

Joshy
by D.J.Peters
Nov 03, 2018 23:10
Forum: DOS
Topic: Custom C64 eumlator crashes in FreeDOS
Replies: 10
Views: 258

Re: Custom C64 eumlator crashes in FreeDOS

print (&H10FFFFFF*2 + &H00FFFFFF) / (1024*1024)
sleep

You allocate 560 MB in DOS or DOSBOX that must fail !

it's a crime what you do with my elegant code ;-)

Joshy

Go to advanced search