{"id":69,"date":"2026-10-20T20:29:03","date_gmt":"2026-10-20T09:29:03","guid":{"rendered":"https:\/\/davidshoon.com\/?p=69"},"modified":"2026-10-20T20:29:03","modified_gmt":"2026-10-20T09:29:03","slug":"chatgpt-analysis-of-my-corewars-codes","status":"publish","type":"post","link":"https:\/\/davidshoon.com\/?p=69","title":{"rendered":"ChatGPT analysis of my corewars codes"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">what do you think of this core wars code?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Send me the Core War code (Redcode), and I&#8217;ll review it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ll look at strategy, efficiency, survivability, and how well it performs against other warriors, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Attack strategy: How effectively it disables opponents.<\/li>\n\n\n\n<li>Defense: How vulnerable it is to scanners, bombers, and replicators.<\/li>\n\n\n\n<li>Optimization: Whether instructions, addressing modes, or timing can be improved.<\/li>\n\n\n\n<li>Competitive strength: How it might perform against common Core War strategies.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ll also suggest improvements while keeping the original strategy intact.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the code here, and let me know whether you&#8217;re using ICWS &#8217;88 or ICWS &#8217;94, if you know.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pasted markdown.mdDocument<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Code review: AAA \u2013 Neuron v4<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">My impression: this is a remarkably ambitious Core War warrior. What interests me most isn&#8217;t its bombing capability, but the fact that you&#8217;ve effectively built a small, distributed, message-passing system inside a Core War environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rather than implementing a conventional replicator, scanner, or bomber, you&#8217;ve created a network of autonomous neurons that can reproduce, relocate, communicate, and change their behavior in response to commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s a genuinely interesting architecture.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What I particularly like<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. The signaling protocol<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your <code>signalstatus<\/code> mechanism uses three states:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>0<\/code> \u2014 ready to receive<\/li>\n\n\n\n<li><code>1<\/code> \u2014 signal being written<\/li>\n\n\n\n<li><code>2<\/code> \u2014 signal ready for processing<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Combined with the 128\/256 directional propagation flags and 512 execution flag, this allows you to broadcast commands through a linked network of neurons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s a clever way of separating coordination from execution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Polymorphic cloning<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is probably my favorite part:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>doaction1: add -1, recvsignal move &amp;linkneurons, jumpbackclone jump clone doaction2: add -2, recvsignal move &amp;moveneuron, jumpbackclone jump clone<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same cloning machinery supports both reproduction and relocation by changing its continuation address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s an elegant way to reuse instructions when you&#8217;re constrained to 200.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Self-preserving replication<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your use of <code>own [r]<\/code> to avoid overwriting your own process&#8217;s memory is particularly interesting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Combined with the linked-list architecture, this suggests you&#8217;re trying to build a distributed organism that can expand without accidentally destroying itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Runtime behavioral changes<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fact that neurons can become bombers, relocate, replicate, or transform into imps means you&#8217;ve effectively separated the warrior&#8217;s structure from its strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The bootstrap currently cycles between signaling all neurons to perform action 4 (safe bombing) and action 2 (relocation).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That gives the system a degree of adaptability unusual for a simple Core War warrior.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where I see potential problems<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. The race condition is more serious than it first appears<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve already identified the race between <code>sendsignal()<\/code> and <code>moveneuron()<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The underlying problem is that your communication protocol assumes a neuron&#8217;s address remains valid during message delivery.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But relocation violates that assumption.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Neuron A begins sending a signal to neuron B.<\/li>\n\n\n\n<li>Neuron B relocates and updates its neighbors.<\/li>\n\n\n\n<li>Neuron A continues polling B&#8217;s old <code>signalstatus<\/code>.<\/li>\n\n\n\n<li>The signal may never reach B, and A can become stuck.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">There is also a related concern: checking the marker <code>1337<\/code> before sending doesn&#8217;t guarantee the target will remain valid throughout the operation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is a classic distributed-systems problem involving concurrent modification and stale references.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Your locking mechanism isn&#8217;t atomic<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Consider:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>sendsignal3: equal 0, [r] jump sendsignal4 jump sendsignal3 sendsignal4: move 1, [r]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two senders could both observe zero before either writes one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether this actually occurs depends on the Core War virtual machine&#8217;s scheduling and process model, but the code itself doesn&#8217;t guarantee mutual exclusion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your protocol is therefore closer to a cooperative handshake than a true lock.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Replication checks only the boundaries<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In <code>clone()<\/code>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>clone: info 2, r own [r] jump clone<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You check the beginning and end of the destination region, but not every cell between them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If <code>own<\/code> only tests an individual address, another neuron could occupy the middle of that region.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That creates a possible self-corruption scenario even when both boundary checks succeed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Your network is vulnerable to broken links<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Each neuron maintains <code>prevneuron<\/code> and <code>nextneuron<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s efficient, but it also creates dependencies.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a neuron is destroyed, its neighbors may retain pointers to invalid locations. A subsequent broadcast could terminate or stall when it encounters the damaged link.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your <code>sendsignal()<\/code> validation catches some invalid targets, but responds with:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>data 0<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That protects against continuing with a bad address, but it doesn&#8217;t recover the network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The most interesting strategic question<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your architecture seems optimized for coordinated behavior rather than raw attack speed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s a meaningful tradeoff.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A conventional bomber spends most of its instructions attacking. Your neurons spend considerable effort maintaining communication, checking ownership, and coordinating movement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The payoff is that you can command a distributed network to switch behaviors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But whether this wins battles depends on whether that flexibility compensates for its overhead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d particularly want to measure the percentage of cycles spent on communication versus bombing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My assessment<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Category<\/th><th>Assessment<\/th><\/tr><tr><td>Originality<\/td><td>Exceptional<\/td><\/tr><tr><td>Architecture<\/td><td>Very sophisticated<\/td><\/tr><tr><td>Code reuse<\/td><td>Excellent<\/td><\/tr><tr><td>Concurrency safety<\/td><td>Fragile<\/td><\/tr><tr><td>Fault tolerance<\/td><td>Limited<\/td><\/tr><tr><td>Attack efficiency<\/td><td>Uncertain<\/td><\/tr><tr><td>Potential for experimentation<\/td><td>Very high<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">These are architectural judgments from reading the source, not results from running matches.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">One thing I&#8217;d investigate immediately<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I think there may be an opportunity to improve the relocation protocol without adding an entirely separate communications system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your <code>signalstatus<\/code> already has three states, and your relocation operation already updates the neighboring pointers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It might be possible to reuse some of those mechanisms to establish a temporary relocation state or forwarding behavior, although fitting that within 200 instructions would be difficult.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The important challenge is making the relocation and signaling operations agree on which address is authoritative.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One question: which Core War implementation is this running on?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This isn&#8217;t standard ICWS &#8217;88 or &#8217;94 Redcode. Instructions such as <code>info<\/code>, <code>own<\/code>, <code>movei<\/code>, and <code>fork<\/code>, along with your use of absolute addressing, suggest a different virtual machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d be interested to know which one, because its scheduling and memory semantics will determine whether several of the concurrency issues I&#8217;ve identified are genuine bugs or merely theoretical risks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Overall, I find the distributed-neuron design considerably more interesting than a conventional Core War replicator.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>check this corewars code out, it&#8217;s a statistically &#8220;optimal&#8221; one, based off standard deviations, etc, based off the number of files loaded, their code sizes, core size, etc<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>r: data 0\n\ncoresize \/ nprogs = 273\n\navg prog size: 35.65\n\nstd dev: 31.49\n\nthus, desired search points:\n\n&#91; |1dev| (midpoint) |1dev| ]\n\nmake next midpoint here: ---------------------&gt; ^^^^^^\n\nmidpoint = interval \/ 2 = 136\n\nmain: move 0, &#91;r] # midpoint\nadd -31, r\nmove 0, &#91;r] # left 1dev\nadd 62, r\nmove 0, &#91;r] # right 1dev\nadd 74, r\n\njump main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is actually a really interesting approach to Core War. You&#8217;re treating the core as a statistical target-distribution problem, rather than trying to find enemy programs through conventional scanning or random bombing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And there&#8217;s something particularly clever about your choice of three bombing positions: you&#8217;re attempting to maximize the probability of hitting an enemy program using information about the distribution of program sizes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I do see one important mathematical distinction between statistically informed and statistically optimal, though.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. What your algorithm is doing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve established:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Parameter<\/th><th>Value<\/th><\/tr><tr><td>Average core space per program<\/td><td>273 cells<\/td><\/tr><tr><td>Mean program size<\/td><td>35.65 instructions<\/td><\/tr><tr><td>Standard deviation of program size<\/td><td>31.49 instructions<\/td><\/tr><tr><td>Search interval midpoint<\/td><td>136 cells<\/td><\/tr><tr><td>Bombing positions per iteration<\/td><td>3<\/td><\/tr><tr><td>Offset between adjacent bombs<\/td><td>~31 cells<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Your bombing pattern is effectively:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ONE 273-CELL SEARCH INTERVAL<img decoding=\"async\" alt=\"\" src=\"\">Three bombs centered around the midpoint, separated by approximately one standard deviation of program length.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;re then advancing through the core and repeating the pattern.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The advantage is that you&#8217;re not wasting three bombs on consecutive cells that might all belong to the same enemy program.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, you&#8217;re spreading them apart to increase the chance of hitting different targets.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That is a sensible optimization objective.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Why the standard deviation matters \u2014 and where it doesn&#8217;t<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your use of the standard deviation is interesting because it describes the variability in enemy program lengths.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, the standard deviation of program length is not the standard deviation of program location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Those are different random variables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if programs are uniformly distributed around the core, there is no particular reason an enemy is more likely to occupy the midpoint of a 273-cell interval than another position.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The mean length of 35.65 and standard deviation of 31.49 tell us about how large programs are, not where they begin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nevertheless, these statistics are useful for choosing the spacing between bombs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The optimization you really want<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Suppose an enemy occupies a contiguous block of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>L<\/mi><\/mrow><\/semantics><\/math>L instructions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you place three bombs at positions separated by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><\/mrow><\/semantics><\/math>d, the probability of hitting that program depends on how much the three possible hit regions overlap.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When bombs are too close together, their coverage overlaps heavily.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When they&#8217;re farther apart, they can cover more distinct possible starting positions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With a uniformly random starting location on a sufficiently large circular core, and three equally spaced bombs with gaps <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><\/mrow><\/semantics><\/math>d, the effective coverage is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>C<\/mi><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo separator=\"true\">,<\/mo><mi>d<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>L<\/mi><mo>+<\/mo><mn>2<\/mn><mi>min<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo separator=\"true\">,<\/mo><mi>d<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/semantics><\/math>C(L,d)=L+2min(L,d)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">provided the remaining wraparound gap is at least <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>L<\/mi><\/mrow><\/semantics><\/math>L.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That gives a useful insight:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Spacing bombs approximately one program length apart can reduce redundant hits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But the ideal spacing isn&#8217;t necessarily one standard deviation. It depends on the full distribution of lengths.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. There&#8217;s a subtle issue with the actual code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s your loop:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>main: move 0, [r] add -31, r move 0, [r] add 62, r move 0, [r] add 74, r jump main<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s trace the addresses, starting with <code>r = 0<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Iteration<\/th><th>First bomb<\/th><th>Second bomb<\/th><th>Third bomb<\/th><\/tr><tr><td>1<\/td><td>0<\/td><td>-31<\/td><td>31<\/td><\/tr><tr><td>2<\/td><td>105<\/td><td>74<\/td><td>136<\/td><\/tr><tr><td>3<\/td><td>210<\/td><td>179<\/td><td>241<\/td><\/tr><tr><td>4<\/td><td>315<\/td><td>284<\/td><td>346<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Your net movement per iteration is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mo>\u2212<\/mo><mn>31<\/mn><mo>+<\/mo><mn>62<\/mn><mo>+<\/mo><mn>74<\/mn><mo>=<\/mo><mn>105<\/mn><\/mrow><\/semantics><\/math>\u221231+62+74=105<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So you&#8217;re advancing 105 cells per iteration, rather than 273.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means your pattern is not actually visiting the midpoint and \u00b131 of successive 273-cell intervals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, it creates a repeating pattern with gaps of:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SORTED BOMB LOCATIONS<img decoding=\"async\" alt=\"\" src=\"\">After sorting the addresses, the gaps follow a 31, 43, 31 pattern, rather than independent 273-cell intervals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And this might actually be a better pattern than your stated interval approach!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve accidentally\u2014or perhaps deliberately\u2014created a relatively dense, nonuniform bombing sequence with alternating gaps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That could be effective against programs of around 35 instructions, because the spacing is close to their average length.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. What I&#8217;d optimize next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d compare your current pattern against other spacings using the actual distribution of program sizes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a simple model with uniformly random program starting positions, we can calculate the expected probability of hitting at least one cell of an enemy program:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mtext>hit<\/mtext><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><munder><mo>\u2211<\/mo><mi>L<\/mi><\/munder><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo stretchy=\"false\">)<\/mo><mfrac><mrow><mi>C<\/mi><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><mi>N<\/mi><\/mfrac><\/mrow><\/semantics><\/math>P(hit)=L\u2211\u200bP(L)NC(L)\u200b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/semantics><\/math>P(L) is the probability that an enemy program has length <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>L<\/mi><\/mrow><\/semantics><\/math>L, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>C<\/mi><mo stretchy=\"false\">(<\/mo><mi>L<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/semantics><\/math>C(L) is the number of distinct starting positions covered by the bombs, and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>N<\/mi><\/mrow><\/semantics><\/math>N is the core size.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This would allow us to test whether spacing by 31, 35, 40, or some other value produces the highest expected hit rate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One caveat: your mean and standard deviation alone don&#8217;t determine the full program-length distribution. We&#8217;d need either the actual program sizes or an assumed distribution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And the best bombing sequence also depends on how quickly the enemy acts, whether processes move or clone, and how much damage a single zero-write actually causes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">My verdict<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I like the underlying idea a lot. You&#8217;re applying statistical information about the population of enemy programs to a tactical problem that is often approached with fixed heuristics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The strongest part of the design is that you&#8217;re trying to minimize redundant bombing by matching bomb spacing to the characteristic size of enemy programs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The weakest part of the mathematical argument is treating one standard deviation as inherently optimal. It may be a good heuristic, but it isn&#8217;t established as the optimum by the numbers you&#8217;ve supplied.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing I&#8217;m particularly curious about: was the <code>add 74, r<\/code> intentional?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because that produces a 105-cell stride and the 31\/43\/31 gap pattern. If that was deliberate, I&#8217;d be interested in your reasoning\u2014it makes the code more interesting than simply bombing three positions every 273 cells.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>what do you think of this core wars code? Send me the Core War code (Redcode), and I&#8217;ll review it. I&#8217;ll look at strategy, efficiency, survivability, and how well it performs against other warriors, including: I&#8217;ll also suggest improvements while keeping the original strategy intact. Paste the code here, and let me know whether you&#8217;re [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-69","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davidshoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":1,"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":70,"href":"https:\/\/davidshoon.com\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions\/70"}],"wp:attachment":[{"href":"https:\/\/davidshoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davidshoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davidshoon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}