Prequel
primitive recursive driven programming


AlgoDeduce

 Loading challenge...

Deduce the algorithm: Press the Next button a few times and try to figure out an algorithm that expresses the relation between the Input and the Expected result. Edit and Run your Prequel program. Complete the challenge with Retry next. Upload solution to improve the Code golf leaderboard.

Run Pause Stop
Runtime Error: DIVISION BY ZERO
256
1048576
65536
← calls
← instructions
← memory (max use: 0)

Status: unknown 


Prequel program

Edit Save Load Debug
Parser Error: UNEXPECTED CHAR

Module: main

algo.return(algo.input)

Input:

ALGO.INPUT
 Number or list
  from which the expected result must be calculated
  and returned through procedure ALGO.RETURN.
CALL.ARGS
 Holds the list of arguments passed with CALL.
 -> [arg1, ..., argN]

Procedures:

ALGO.RETURN(result)
 End computation and
  compare the calculated result
  against the expected result.
 Succeeds if there is a match; fails otherwise.
CALL(&retvar1, ..., &retvarM, @modname, arg1, ..., argN)
 Start executing module modname, copying N arguments and expecting M return values.
 -> retvar: name of variable to hold the corresponding return value retval
 -> modname: name of module to start executing
 -> arg: value to be copied to the list CALL.ARGS
 Alternative syntax: retvar1, ..., retvarM = CALL(@modname, arg1, ..., argN)
 Note that recursive module calls are not allowed.
RETURN(retval1, ..., retvalM)
 Return M values from the current module.
 Resume execution at the next instruction of the corresponding CALL.
 -> retval: value to be copied to the corresponding variable retvar

Available examples:

Prequel, ToPAS?