jd63
2021-10-22 14:11:32 UTC
This concerns the Linux version only (native compiler). Version 2.60 from github. The code uses the RANDOMIZE and RANDOM functions from the Lib module, and WrLn from IO. Compiled with "xc -topspeed+ =m randtest.mod".
MODULE randtest;
IMPORT IO,Lib;
VAR roll,i: CARDINAL;
BEGIN
Lib.RANDOMIZE;
FOR i:=1 TO 6 DO
roll:=Lib.RANDOM(6)+1;
IO.WrCard(roll,1);
IO.WrLn;
END;
END randtest.
Firstly, RANDOMIZE doesn't work because on each run the numbers are the same, and secondly, carriage return isn't working in WrLn because on successive new lines the numbers are cumulatively offset by 1 space.
The Win32 version of the compiler (using Wine) produces the expected correct output (no offsets and different numbers each time).
I haven't raised this issue yet on github because I first wanted to see if there are any other XDS users getting the same behaviour.
Thanks!
MODULE randtest;
IMPORT IO,Lib;
VAR roll,i: CARDINAL;
BEGIN
Lib.RANDOMIZE;
FOR i:=1 TO 6 DO
roll:=Lib.RANDOM(6)+1;
IO.WrCard(roll,1);
IO.WrLn;
END;
END randtest.
Firstly, RANDOMIZE doesn't work because on each run the numbers are the same, and secondly, carriage return isn't working in WrLn because on successive new lines the numbers are cumulatively offset by 1 space.
The Win32 version of the compiler (using Wine) produces the expected correct output (no offsets and different numbers each time).
I haven't raised this issue yet on github because I first wanted to see if there are any other XDS users getting the same behaviour.
Thanks!