Karel - Declaring an Array of Constants

  • 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?

    EDIT: Posted in the wrong section by mistake, sorry.

    Edited 2 times, last by dcrb ().

  • AD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now