No, but ...by (no login)
I fund a solution last night...
Here the problem again, it's a printing routine, it should be optimized for 32mhz and less speed.
7 lines, each line is an array of characters, X location, Y location. Now we have to pick randomly between the lines AND the characters.
1) The computer is too slow to scramble just before printing, therefore it should be done previously ; the "i" index is related to a scrambled table.
Imagine the line is shorter as the previously scrambled "i" index, so maybe at the beginning of the line, i = 2 will be replaced by y = 100 and char position 100 doesn't exist. Ok ? So i will simply SKIP this index ! et voilà, i was thinking about MOD but all other solutions are too complex because it implies checking the whole line for unprinted chars.
2) i implement an counter for telling the whole line is printed, so if "j" is returning to the line it is skipped too, so maybe if line 5 is full, "j" should be random between 1, 2, 3, 4,... 6, 7 etc. J is more tricky to implement... i don't want to rely on random only, because i may fall into a gap. So if 5 is the chosen again, i may replace it by the next one. The "j" routine selecting the line must know also if all characters have been printed, therefore we need a global count (and a count for each line separately)
So this is much of text, because i was struggling whith the solution and foremost i rapidly come out of practice with Qbasic ...
|Response Title||Author and Date|
|I've got Psuedo random||on Sep 27|
|yes but||on Sep 28|
|The idea is ...||on Oct 3|
|Better one :||on Oct 3|