2.0.1 • Published 10 months ago

@rekarel/cli v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

NPM Version

This is the command line interface for a Karel compiler.

Install

npm install -g @rekarel/cli

Commands

Versioning

rekarel [-V]

Shows the version of the rekarel command.

Run

rekarel run <filename> [-i world.in] [-o world.out]

Runs a filename (if it has extension .kx it runs it directly, otherwise it compiles it first) and outputs the world.out to stdout

Arguments

  • -i If a world.in is not supplied, it reads the world from stdin, but if specified, then it reads the file.

  • -oIf a world.out is not supplied, it prints the output to stdout, but if specidied, then it writes to the path provided.

Behaviour

Depending on how the execution ends, the console returns a exit signal and may print to stderr based on the follow table:

StatusExit signalStderrDescription
OK0----No error, execution succeeded.
WALL16MOVIMIENTO INVALIDOKarel tried to move into a wall.
WORLDUNDERFLOW17ZUMBADOR INVALIDO MUNDOKarel tried to take a beeper on an empty cell.
BAGUNDERFLOW18ZUMBADOR INVALIDO MOCHILAKarel tried to leave a beeper with an empty bag.
STACK19STACK OVERFLOWKarel suffered a stack overflow.
STACKMEMORY20LIMITE DE MEMORIA DEL STACKKarel exceeded the stack memory limits.
CALLSIZE21LIMITE DE LONGITUD DE LLAMADAKarel exceeded the number of parameters permitted in a call.
INSTRUCTION48LIMITE DE INSTRUCCIONES GENERALKarel exceeded the general number of allowed instructions.
INSTRUCTION_LEFT49LIMITE DE INSTRUCCIONES IZQUIERDAKarel exceeded the number of allowed turnleft.
INSTRUCTION_FORWARD50LIMITE DE INSTRUCCIONES AVANZAKarel exceeded the number of allowed move.
INSTRUCTION_PICKBUZZER51LIMITE DE INSTRUCCIONES COGE_ZUMBADORKarel exceeded the number of allowed pickbeeper.
INSTRUCTION_LEAVEBUZZER52LIMITE DE INSTRUCCIONES DEJA_ZUMBADORKarel exceeded the number of allowed putbeeper.

Notice that what is usually considered RTE has only 16 bit on, while errors that are considered TLE or Instruction limit exceeded (ILE) have both the 16 and 32 bit on.

Compile

rekarel compile <filename> [-l java|pascal] [-o output]

Compiles a source code into a .kx file, Karel's bytecode

Arguments

  • -l --language If set, it tries to compile to the specified target language. If not, the compiler attempts to detect the language.
  • -o --output If set, it compiles to the target file, if not, it generates a file named a.kp
2.0.1

10 months ago

2.0.0

10 months ago

1.6.4

11 months ago

1.6.3

11 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago