Redcode: Difference between revisions

Content deleted Content added
Updated url to Core Wars Guidelines due to ociw.edu being sunset
Line 12:
;No external access: Redcode and the MARS architecture provide no input or output functions. The simulator is a closed system, with the only input being the initial values of the memory and the process queues, and the only output being the outcome of the battle, i.e. which programs had surviving processes. Of course, the simulator may still allow external inspection and modification of the memory while the simulation is running.
;Constant instruction length and time: Each Redcode instruction occupies exactly one memory slot and takes exactly one cycle to execute. The rate at which a process executes instructions, however, depends on the number of other processes in the queue, as processing time is shared equally.
;Relatively few instructions: The earliest published version of Redcode had only eight instructions, while the currently used version has eighteen. However, it should be noted that Redcode supports a number of different addressing modes and (in later versions) instruction modifiers which increase the actual number of possible opcodes to several thousand.
;All addresses are valid: All numbers in Redcode are treated as unsigned integers, and the [[maximum integer]] value is set to equal the number of memory locations minus one. Thus each integer is a valid address, and each memory ___location has exactly one valid address. Numbers that would fall outside the valid range are wrapped around according to the usual rules of [[modulo arithmetic]].
;Circular memory: As a consequence of the above and the lack of absolute addressing, the memory space (or ''core'') appears to the programs in it as a circle with no definite start or end. A process that encounters no invalid or jump instructions can continue executing successive instructions endlessly, eventually returning to the instruction where it started.