Live data from Hacker News

Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

dev.moment.com

71–80 of 88 posts

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#72
I 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 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 main

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#73

I 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…

thanks for the bug report! oversight on my part, pushing hex support rn :)

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#74

That'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.

[deleted]

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#75
Thank you, Thank you, Thank you. I'm absolutely having a great time immersing myself in this, but I'm super sad about the day it will be taken down and i cant play anymore. Maybe that day is when the contest is over? Will there be some way i can keep enjoying this beautiful little world after the contest?

I 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

#77

That 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!

Very fun. I'm the 7th place, contact me if you want to share solutions out of curiosity

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#79

That 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!

I published my submission and all supporting information here, in case anyone is curious! https://github.com/CGamesPlay/moment-swarm

Re: Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

#80
Thanks for organizing this! I had a great time playing with the system for a week even though I did not get anywhere close to the prize pool.

I 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.

Post reply on HN