The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Varying speed when running program
03-18-2019, 08:18 AM
Post: #1
Varying speed when running program
When playing with some cellular automata, I had now a smaller program showing speed variation when executed.
Code:
#pragma mode( separator(.,;) integer(h32) )
EXPORT Langton() BEGIN
 LOCAL DX:=[0,1,0,−1];
 LOCAL DY:=[1,0,−1,0];
 LOCAL ST:=TICKS;
 RECT();
 160▶X;120▶Y;1▶D;0▶N;
 REPEAT
  IF GETPIX_P(X,Y) THEN (D MOD 4)+1▶D;PIXON_P(X,Y,#000000);
  ELSE ((D+2) MOD 4)+1▶D;PIXON_P(X,Y,#FFFFFF);END;
  (X+DX(D)) MOD 320▶X;(Y+DY(D)) MOD 240▶Y;N+1▶N;
 UNTIL GETKEY=41;
 RETURN 1000*N/(TICKS-ST);
END;
Severall runs leads to this kind of speed (measured as generations by second)
Code:
10739
10720
9615.9
4573.2
3718.8
1141
733.19
726.11
727.4
Each run was done for a few seconds. When speed is slow, it stay slow even when using keyboard during the run. Turning calc off and on next day gives:
Code:
680.13
740.29
687.81
435.92
506.47
515.38
516.15
10791
Running the program was done in HOME, by typing Langton then ENTER, stopping it is done by pressing SHIFT, re-run it is done by simply pressing again ENTER and so on ...

This was done without usb connection on G2 hardware (I can not test it on older hardware revision).

There are also some problems with matrix in HOME mode (see Other bugs)

P.S. I still talk about varying speed because nobody seems to react to this kind of annoying problem...

Olivier
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Varying speed when running program - Oulan - 03-18-2019 08:18 AM



User(s) browsing this thread: 1 Guest(s)