Search found 678 matches

by grindstone
Mar 27, 2020 13:04
Forum: Community Discussion
Topic: Freebasic is not smooth in graphics
Replies: 17
Views: 713

Re: Freebasic is not smooth in graphics

Hello nenver and welcome to the forum! Although FB has no built-in sprites, there are tools to smoothen graphics, but you have to take care of it yourself. Have a look at these keywords: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgScreengraphics https://www.freebasic.net/wiki/wikka.php?wakka...
by grindstone
Mar 26, 2020 16:17
Forum: General
Topic: Corona virus simulator
Replies: 41
Views: 1399

Re: Corona virus simulator

@dodicat: Nice work!
by grindstone
Mar 24, 2020 13:59
Forum: General
Topic: Corona virus simulator
Replies: 41
Views: 1399

Re: Corona virus simulator

Nice work!
by grindstone
Mar 24, 2020 13:42
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 56
Views: 1642

Re: Parse string to tree structure

One small issue: It does not display all items in a path before all sub-paths ("files before folders"). This can easily be fixed by a slight modification of the printTree sub: Sub printTree(tp As tDirTreeNode Ptr) Print String(tp->depth, " "); "+ "; tp->fname 'print th...
by grindstone
Mar 23, 2020 13:56
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 56
Views: 1642

Re: Parse string to tree structure

@badidea: With that "double - typing" you're making it unnecessary complicated. You can simply put it all in a single type... type tree_type dim as string path dim as string item(any) dim as tree_type ptr pChild(any) declare sub addItem(objectStr as string, sepChar as string) declare sub s...
by grindstone
Mar 22, 2020 18:28
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 56
Views: 1642

Re: Parse string to tree structure

@badidea: Great work! That reminds me that I have to clean my nesting boxes (and my letter box, too, I get this little lodger since three years). http://users.freebasic-portal.de/grindstone/Screenshots/Meise3.jpg And here are my two pennies to the tree parser: #Include "dirTree.bi" Dim As ...
by grindstone
Mar 20, 2020 16:01
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 56
Views: 1642

Re: Parse string to tree structure

In the meantime I put the tTreeNode class into a library I call "dirTree.bi": #Include Once "dir.bi" Type tDirTreeNode As String fName 'name of the current subfolder As UInteger attr 'attributes As Integer depth 'tree depth of the current folder As boolean deflate = TRUE 'deflati...
by grindstone
Mar 20, 2020 13:25
Forum: General
Topic: Parse string to tree structure (solved)
Replies: 56
Views: 1642

Re: Parse string to tree structure

Something like this ?
by grindstone
Mar 18, 2020 14:37
Forum: General
Topic: virus outbreak sim
Replies: 12
Views: 504

Re: virus outbreak sim

the dead are moving !! Maybe zombies? *grin* Tip: In FB a TYPE can contain an array of itself: type thuman dim as double x , y '' spot of thuman dim as long kl '' color state of thuman dim as integer tijd1 , tijd2 ''counter for keeping time Static As thuman human() 'humans array Declare Sub act(<op...
by grindstone
Mar 10, 2020 14:30
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

I recoded my snippet to really count (instead of calculate) the number of values. Const tallylen = 256^4/8 Dim As String str1, substr, dict Dim As Integer strlen, dummy, inputcount, outputcount Dim As ULong Ptr von, bis Dim As UByte Ptr dictptr, tally = Callocate(tallylen) Open ExePath + "\inpu...
by grindstone
Mar 09, 2020 13:34
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

Thank you for testing, due to it I found a bug in my code (and fixed it, see above). But very strange - our machines seem to behave quite different: 10000000 characters: instrtest11: 0.689609581455835 tally: 0.4877191733044564 20000000 characters: instrtest11: 1.343974237574243 tally: 0.678297967142...
by grindstone
Mar 08, 2020 22:32
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

And now the same with assembly code. Anyone to beat this? Const tallylen = 256^4/8 Dim As String str1, substr, dict Dim As Integer strlen, dummy Dim As ULong Ptr von, bis Dim As UByte Ptr dictptr, tally = Callocate(tallylen) strlen = 10000000 'strlen = 13*1024*1024 'strlen = 12 str1 = String(strlen,...
by grindstone
Mar 07, 2020 15:30
Forum: Windows
Topic: Epoch time.
Replies: 30
Views: 972

Re: Epoch time.

deltarho[1859] wrote:With that epoch my date of birth epoch time is 1512518400000. I may change the epoch to 1 January 1920 making folk think that I am younger than I really am. Image
And I assumed you were born in 1859... *grin*
by grindstone
Mar 06, 2020 14:49
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

A different approach (my thanks to dodicat for mentioning the tally string). I think this can stick with jimg's code - without assembly *grin* : Dim As String str1, substr Dim As String dict Dim As Integer strlen Dim As UByte Ptr stp Const tallylen = 256^4/8 Dim As UByte Ptr tally = Callocate(tallyl...
by grindstone
Mar 05, 2020 5:02
Forum: General
Topic: Instr()
Replies: 25
Views: 845

Re: Instr()

Very impressive! I've tried another way to do the job: Writing the 4-byte-words into a tree structure and then traverse the tree to create the dictionary string. It works nearly as fast as jimg's code, but it runs out of memory (on my 32 bit machine) if the number of different words exceeds a certai...

Go to advanced search