Visual sorts

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
Aethelstan
Posts: 19
Joined: Feb 22, 2017 18:34

Re: Visual sorts

Post by Aethelstan »

D.J.Peters wrote:27 elements bla bla bla ;-)
dodicat wrote:Probably the best thing for you to do is not interfere in any of my threads.
I'll do the same with yours.
Farewell.
Please, guys! This is not an and of the world. No need to quarrel about it. Sure, this is not a benchmark of sorting methods, I hope that everybody here understands that (27 elements - even without graphical overhaul - give only a very limited testing environment), but it's also quite a nice code example that may have educational value not only for beginners (and not only in sorting subject).
Dodicat, Joshy, you are both giving valuable contribution to this site and I hope this won't change because of such misunderstanding.
And there is no reason to say 'farewell' because of that!

Please, stay calm.
And sorry for offtopic - but I felt someone should interfere here (don't think that I like it ;).
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Visual sorts

Post by fxm »

I agree.

I, too, have recently undergone a personal attack on my work for the documentation, like I had treated badly the proposals of some new users or beginners (no quoting for not reviving the flame).
I find this unacceptable, especially when such a person does not do anything or even does not propose anything precise instead.
Makoto WATANABE
Posts: 231
Joined: Apr 10, 2010 11:41
Location: Japan
Contact:

Re: Visual sorts

Post by Makoto WATANABE »

Dear fxm

I appreciate your involvement.

> Have you tried removing all the 'screenlock' and 'screenunlock' instructions,

I removed all the 'screenlock' and 'screenunlock'. However, on my Win 10 environment, running the exes crashed.

> No crash on Win 7,

Surely! I compiled executables on my Win 8.1 and FB 32-bit , they display the expected screen without crash.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Visual sorts

Post by fxm »

I looked at the code a bit.

In "Sub draw_string()",
try to replace:
Screenres 10,10,32 '8 x 8 pixels on this screen
with:
Screenres 200,10,32 '8 x 8 pixels on this screen

If by chance it worked, try the optimized instruction:
Screenres 10,10,32, ,FB.GFX_NO_FRAME '8 x 8 pixels on this screen
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Visual sorts

Post by jj2007 »

Aethelstan wrote:Sure, this is not a benchmark of sorting methods, I hope that everybody here understands that (27 elements - even without graphical overhaul - give only a very limited testing environment)
For a serious benchmarking exercise, #elements should be in the Millions. On Masm32, we did some comparisons between Masm32 lib, MasmBasic, and the CRT qsort algos, using a bible.txt from the Canterbury Corpus as input. Six Million lines to be sorted, in about six seconds. You need a bit of RAM, though.
Makoto WATANABE
Posts: 231
Joined: Apr 10, 2010 11:41
Location: Japan
Contact:

Re: Visual sorts

Post by Makoto WATANABE »

Dear fxm

Thank you for looking the code.
Unfortunately, I changed the Parameters of Screenres, but still crashed in win10.
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Visual sorts

Post by fxm »

I can not help you anymore without having the crash myself.
dodicat wrote:I added a screenunlock before leaving subs or by closing the window.
made a screen 0 just before exit.
Also made integers to longs for 64 bit.
tested on (Windows 10 64 bit, FreeBASIC 32 bit) and FreeBASIC 64 bit.

But I had no crash with the original.
Hope it is better now.
(fixed lcase) via fxm).
Maybe dodicat could reconfirm that the 7 sorts work well on Windows 10 for both 32-bit and 64-bit compile.
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: Visual sorts

Post by bcohio2001 »

Confimed -- Win10 -- both 32 and 64 bit.
Post Reply