Search found 263 matches

by xlucas
Jul 28, 2018 21:36
Forum: General
Topic: Prime number distribution at sight
Replies: 11
Views: 511

Re: Prime number distribution at sight

Indeed there are rules to distribute prime numbers. [...] Some biologists suggest that other species might use prime numbers. Example: https://www.bbc.co.uk/news/magazine-14305667 [...] Indeed, I had read about this thing on cicadas before! It makes sense, in my opinion, that animals and even simpl...
by xlucas
Jul 27, 2018 23:06
Forum: General
Topic: Prime number distribution at sight
Replies: 11
Views: 511

Re: Prime number distribution at sight

jj2007: Yeah, ha, ha... it looks like nature wasn't able to hide the non-randomness of the prime number distribution very well :P I actually created the program because I suspected that, if I separated Gaussian primes from non-Gaussian primes, I was going to see some conspicuous effect, but it wasn...
by xlucas
Jul 24, 2018 5:01
Forum: General
Topic: Prime number distribution at sight
Replies: 11
Views: 511

Prime number distribution at sight

This is a well known trick discovered by somebody whose name I don't remember. Thing is, for the one who doesn't know, prime number distribution seems to be incredibly random and mathematicians have been for centuries trying to find an infallible rule, to no success. Yet, from time to time, some gen...
by xlucas
Jan 03, 2018 4:41
Forum: General
Topic: Graphical letters in textscreen
Replies: 10
Views: 515

Re: Graphical letters in textscreen

Console mode is not the same as text mode. It sounds obvious, but until the first time I realised how true this was, I was sure the difference was something more subtle. If you've started your programming in DOS, like I did, then you're used to being able to exploit the whole of the hardware text mo...
by xlucas
Dec 21, 2017 19:04
Forum: General
Topic: Goto var
Replies: 15
Views: 638

Re: Goto var

Yes. That is true. It all depends on the size of your var and how fast you want the thing to be. But it's something that comes with FreeBasic without hacking and it's pretty fast with that in consideration. Maybe the best "vanilla" option.
by xlucas
Dec 21, 2017 18:57
Forum: General
Topic: Managing 2 windows (or window/console) without additional libs
Replies: 5
Views: 363

Re: Managing 2 windows (or window/console) without additional libs

Another solution would be to create a frameless, transparent window the size of the desktop (or two desktops), use a transparent background and draw the windows yourself. It can be a lot of work, but depending on what you want it for, maybe it's what you'd prefer to do.
by xlucas
Dec 21, 2017 18:48
Forum: General
Topic: Goto var
Replies: 15
Views: 638

Re: Goto var

Select Case As Const is the fast alternative to Select Case that does just what Albert was asking, I think. If I understand correctly, it uses a translation table instead of comparing for each value. So that'd be a XLAT followed by a JMP , right? I personally see Select Case As Const as the modern ...
by xlucas
Dec 03, 2017 2:24
Forum: Community Discussion
Topic: time to say goodbye
Replies: 53
Views: 4170

Re: time to say goodbye

FreeBASIC is a boat without a captain. BASIC is for beginners and this is OK but too much idiots and trolls here and the moderators are blind or sleeping. It'd really be a great loss if you go, Joshy. I wonder if you'll actually read all these posts. There's a couple of points I'd like to make abou...
by xlucas
Nov 23, 2017 7:09
Forum: Tips and Tricks
Topic: draw rotated ellipse
Replies: 8
Views: 672

Re: rotate oval

That looks very neat, mate! :) It occurs to me that, instead of the space bar, the right mouse button could be used to switch between changing the radius and rotating the oval. Just an idea.
by xlucas
Nov 23, 2017 7:02
Forum: General
Topic: Signed/unsigned equality. Bug?
Replies: 17
Views: 786

Re: Signed/unsigned equality. Bug?

Maybe. But well, I wasn't able to replicate that in my shorter example. I'd like to be able to isolate the effect. I thought I had when I first posted. The TargaSave function does have that, but the shorter code seems to always compile the same.
by xlucas
Nov 23, 2017 6:33
Forum: General
Topic: How non-random was QB's RND
Replies: 40
Views: 1013

Re: How non-random was QB's RND

We still have not got the answer, but are we getting any closer? I think we already have like half the answer, ha, ha. I've been thinking about this and testing the code. I haven't been able to make your LCG produce the same results, but I think that makes sense. Strictly speaking counting_pine's f...
by xlucas
Nov 23, 2017 3:04
Forum: General
Topic: How non-random was QB's RND
Replies: 40
Views: 1013

Re: How non-random was QB's RND

Well, yes and no. The PRNG is very good for most tasks. If you just use a few requests, then it's impossible to notice anything. On the other hand, I found this pattern after only one year of playing with QB, without looking for anything and completely by chance. What I mean is, another person, more...
by xlucas
Nov 23, 2017 0:33
Forum: General
Topic: Signed/unsigned equality. Bug?
Replies: 17
Views: 786

Re: Signed/unsigned equality. Bug?

Compilers don't compare binaries. They create a tree node for the comparison, and the semantic phase of the compiler will insert needed conversions to make the types match a pair that the compiler has a comparison for. You clearly know a lot more than I about the matter and you've said it in better...
by xlucas
Nov 23, 2017 0:06
Forum: General
Topic: How non-random was QB's RND
Replies: 40
Views: 1013

Re: How non-random was QB's RND

That is not correct. (4) is redundant. Ooops! Actually, that parameter 4 is a mistake I made. It wasn't present in the original code I wrote in the 90s. What happened is that I "misremembered" that FB allowed one to select the PRNG method by changing the parameter in RND , so I started tr...
by xlucas
Nov 22, 2017 1:14
Forum: General
Topic: How non-random was QB's RND
Replies: 40
Views: 1013

How non-random was QB's RND

Just wanted to post a slightly modified short BAS program I made in 1994 in QuickBasic. I don't know what I was trying to do and suddenly, I got this result, which made me realise how non-random QB's RND was, so I saved it. Now, when I saw FB is capable of reproducing the same RND function, I wonder...

Go to advanced search