Hey there,
My issue is quite simple: I am using a set number of registers and declaring them at the begining in the CONST section. I would like to be able to put them all inside an array instead of having N different constants.
I know I can put those values in an array by doing the following code and assigning it one by one but I'm wondering is if you can do it in one line as you can do in most languages, with something like: ARRAY=[1,5,8,4,7,12] (for example). Is that possible in Karel?
Code
CONST
A_REG = 1
B_REG = 6
...
N_REG = M
VAR
REGS: ARRAY[N] OF INTEGER
BEGIN
ARRAY[1] = A_REG
ARRAY[2] = B_REG
...
ARRAY[N] = N_REG
Display More
EDIT: Posted in the wrong section by mistake, sorry.