I am running a Fenuc Karel robot for a class assignment which uses a variation of Pascal however our robot is from 1991-1993 before they added random(). Does anyone know how to get a random number on an old dos implementation of Pascal? Please note because of the age variable names can't be more than 8 characters and numbers can't count past 255
If it is a borland pascal version, you can use asm { … }
blocks, which would allow you to get a value from the RTC, which is sufficiently random for many intents and purposes. Given a variable random:
asm {
xor ax, ax;
int 1ah;
mv random, al;
}
This would give you the last 8 bit of the real time clock value.
Apart from that you could look for pseudorandom number generation on old machines, e.g. C64; though you'd have to port the code to pascal.
Update: It appears, Fanuc Karel (I hope this is it) has a GET_TIME routine, though I'm unsure about what that returns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With