Re: More Core War
- Posted by Robert Pilkington <pilking at BELLATLANTIC.NET> Aug 26, 1999
- 451 views
> a) It gets too far away from the Corewars that the rest of the world plays. > The warriors in the Euphoria corewars would behave differently than the > same warriors in the real corewars, because the virtual machines are not > equivalent. In the present version, bombing memory location means bombing > a whole instruction. This is quite different from just bombing a byte of an > instruction, which is what I understand happens in real corewars. Actually, the behavior of Rod's Core Wars is the same as in other Core War MARS programs. The only differences between Rod's and the other MARSes, are these: MOV #5, 1 MOV 5, 0 CoreScript = Move DAT #0, #5 to the second statement RedCode = Move #5 to the B-field (the 0) of the second statement (I think) JMP 5 CoreScript = JMP #0, 5 Redcode = JMP #5, #0 (Redcode uses the A-field for JMP, while CoreScript uses the B-field) A DAT bomb bombs instructions, not bytes so that the DAT statement is executed, which terminates the program (or process, once SPL is implimented). The basic idea in Redcode ("real Core War") and CoreScript is the same, but the handling of the instructions is a little different. In both languages, the Imp works the same way: (Although a compiler/parser will be needed to convert the code for CoreScript) MOV 0, 1 It moves (well, copies) the instruction at 0 to one instruction ahead of it. Then the program moves to the next instruction in the array. Which happens to be exactly where the previous command had copied to. So the Core looks like this: MOV 0, 1 MOV 0, 1 <- Current statement (about to be executed) DAT 0, 0 < - Next statement When the current statement is executed, the DAT (or whatever happens to be next) is overwritten with the MOV. > c) Besides getting away from corewars, this virtual machine gets away from > being like a computer too - it's got a whole architecture of it's own, based > on instructions rather than bytes. One of the things I liked about corewars > was getting into the innards of a virtual CPU, to see how computers worked > at that level. The virtual computer in Core War (MARS (Memory Array Redcode Simulator) is described in the Core War FAQ at www.koth.org as an array of instructions. (Not as an array of bytes.) So they are mostly the same. (In fact, with the progress made so far, it doesn't seem like it'd be too much work to get compliance with Redcode '88... I could be wrong though, but it just seems a few extra instructions and some modifying of a couple instructions should do it.) Also, somewhere that I read stated that if Redcode and MARS worked like a true virtual computer, then it would be so complex that very few people would be able to write successful programs, much less understand them. I just thought I'd toss my two DAT bombs in. :)