Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
71–80 of 88 posts
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#72In the reference material under ARITHMETIC, it shows `AND r1 0xFF` as valid. However, actually using that code always produces zero regardless of what is in r1. My experiment concluded that only decimal inputs are supported, and hexadecimal are not, but the reference doesn't say that, and the editor doesn't flag the hexadecimal inputs as an error. Perhaps the reference material should be updated to simply show "255" instead of "0xFF".
Here is code to reproduce:
; ==================================================
; Bug Report:
; AND operation returns 0 when give a hex argument
;
; Expected behavior:
; (1 AND 0xF) should either equal 1 or the
; line should be flagged as an error.
;
; Actual behavior:
; (1 AND 0xF) equals 0 and does not flag error.
; ==================================================
.alias input r0
.alias output_using_hex r1
.alias output_using_dec r2
main:
; Pick any number only using bits 0xF
SET input 1
; Test using hex
SET output_using_hex input
AND output_using_hex 0xF ; no error raised
; Test using decimal
SET output_using_dec input
AND output_using_dec 15 ; (15 == 0xF)
PICKUP ; end the tick, so registers are stable
; Registers at this tick boundary:
; input: 1
; output_using_hex: 0 (incorrect)
; output_using_dec: 1 (correct)
JMP mainRe: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#73I think I found a bug: In the reference material under ARITHMETIC, it shows `AND r1 0xFF` as valid. However, actually using that code always produces zero regardless of what is in r1. My experiment concluded that only decimal inputs are supported, and hexadecimal are not, but the reference doesn't say that, and the editor doesn't flag the hexadecimal inputs as an error. Perhaps the reference material should be update…
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#74That's really cute, it reminds me that Will Wright (creator of The Sims) has referenced this book "The Ants", by Bert Holldobler in multiple occasions as a key inspiration for his games (and in particular SimAnt) and systems thinking. Did you come across that during your research phase or had you not heard about it? I haven't read it yet, but maybe someday I'll get around to it.
Hey, I'm the one who built this particular challenge! I had no clue, but thanks for the book lead! It didn't come up directly, but SimCity 2000 and especially SimCity 4 had a huge impact on me growing up / I still spin up SimCity 4 from time to time, so I imagine there's a massive indirect influence haha.
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#75I know opening up the source or keeping the hosting up might be really hard to do for legal, security, cost or a million other complicated reasons. so if its not possible, thank you anyway :)
So simple and beautiful. So addicting. Love it! Thank you!
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#76Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#77That was fun! Will there be a blog post / showcase or anything? I came in 9th, and will definitely be writing a blog post. I did not write a single line of antssembly during the contest!
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#78Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#79That was fun! Will there be a blog post / showcase or anything? I came in 9th, and will definitely be writing a blog post. I did not write a single line of antssembly during the contest!
Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language
#80I have no idea if anyone checks these threads after a week but not that it's over, I am super curious what strategies other folks used. I used a python script to pre-process my programs to minimize jumps and downloaded the sim to run an iterative optimizer with parallelization. I just put a little writeup and the code on github https://github.com/Will-Morr/MomentSwarm.