Skip to content
Snippets Groups Projects
Commit a19c33cd authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Notizen und Beispiele 9.5.2023

parent c274d542
No related branches found
No related tags found
No related merge requests found
;redcode
;name Antiknirps
;author Peter Gerwinski
;strategy Modifiziere den Code von Knirps, um ihn zu stoppen
;assert 1
falle DAT #0
DAT #0
start JMP start, <falle
END start
;redcode
;name Antiknirps
;author Peter Gerwinski
;strategy Modifiziere den Code von Knirps, um ihn zu stoppen
;assert 1
falle DAT #0
DAT #0
start DJN start, falle
JMP start
END start
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf SUB #4, bomb
MOV bomb, @bomb
JMP dwarf
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf SUB #2, bomb
MOV bomb, <bomb
DJN dwarf, bomb
JMP dwarf
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf SUB #2, bomb
MOV bomb, <bomb
JMP dwarf, <bomb
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf SUB #2, bomb
MOV knirps, <bomb
JMP dwarf, <bomb
knirps MOV 0, 1
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf SUB #3, bomb
MOV bomb, <bomb
JMP dwarf
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
bomb DAT #0
DAT #0
dwarf MOV bomb, <bomb
JMP dwarf, <bomb
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
;redcode
;name Dwarf
;author A. K. Dewdney
;strategy Throw DAT bombs around memory, hitting every 4th memory cell.
;strategy This program was presented in the first Corewar article.
;assert 1
ptr DAT #0
DAT #0
dwarf SUB #2, ptr
MOV bomb, <ptr
JMP dwarf, <ptr
bomb DAT #0
END dwarf ; Programs start at the first line unless
; an "END start" pseudo-op appears to indicate
; the first logical instruction. Also, nothing
; after the END instruction will be assembled.
xzoom -mag 2 -source 640x480+0+0 &
./pmars -s 4001 -p 64 -e -v 704 knirps.red dwarf-ak-06.red
Warum spielt der optimierte Dwarf gegen Knirps unentschieden?
mov -2, <-2
- Dwarf liest die Speicherzelle ("in ein Primary-Secondary-D-Flipflop").
- Dwarf dekrementiert die Speicherzelle. Danach zeigt sie auf sich selbst.
- Dwarf speichert die soeben gelesene Kopie wieder in der Speicherzelle.
Lösung des Problems: etwas anderes dorthin-mov-en.
(Beim Testen hatten wir noch einmal das alte Programm getestet.)
Physik: https://www.peter.gerwinski.de/physik/
Knirps-Lanze
mov 1 20
--> durch spl-Befehl verlangsamen, dann grundsätzlich kampfstark
Selbsterkennung ohne Schwanz
- Suchen mit großer Schrittweite
- etwas gefunden: Schritt zurück, dann kontinuierlich suchen
- letzte Speicherzelle (Adresse bekannt!) des eigenen Programms gefunden --> überspringen
Nachteil: rechenzeitintensiv
- Man verliert gegen Gegner, die "interessante" Muster in den Speicher malen.
Stealth-Taktik: Man wird nicht gefunden von Gegnern, die nach != 0 suchen.
mov #42, 0
mov #137, 0
mov #13, 0
...
Nachteil: rechenzeitintensiv
Knirps als Waffe gegen Mäuse?
- mit Knirpsen schießen
--> Maus wird zu Knirps, räumt andere Mäuse ab.
- Eigene Knirpsfalle sammelt die Mäuse ein.
--> Hat in der Praxis bis jetzt nicht funktioniert.
Gegner für sich selbst arbeiten lassen: chml83b.red
Supermaus?
Idee: Mice geht freiwillig direkt in eine Laufzeitfalle.
Von Anfang an 64 Tasks.
Beim Vermehren gehen 32 in die Kopie, 32 bleiben im Original.
Danach splitten wir uns weiter auf.
--> Treffer durch Laufzeitfalle sind vergleichsweise harmlos.
Problem: Koordinierung der verschiedenen Threads.
- Kopieren sollte funktionieren. (Evtl. wird die Kopie zu lang.)
- Aufteilen beim SPL: selbstmodifizierender Code
(z.B. eigenen SPL-Befehl mit JMP überschreiben)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment