Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
dtanzer
@dtanzer@social.devteams.at  ·  activity timestamp last week

I now have a GUI for my #rust #GameOfLife
Will optimize the code a bit and try to test _some_ of the UI code with unit tests.

Then I might record a video, since I did not yet find one on youtube where someone implements it in Rust using #TDD (if you know such a video, please forward it to me).

  • Copy link
  • Flag this post
  • Block
dtanzer
@dtanzer@social.devteams.at replied  ·  activity timestamp last week

Minor optimization: There are only two grids, an even and an odd one.
https://codeberg.org/dtanzer/game-of-life/commit/e9a46948304a5d6a9cd0f24b50e39376cbb5734b

Moved "count_neighbors" outside the "Board", because I couldn't get it to work with the mutable and immuntable borrows of self that would occur when I'd leave it inside. Don't like that, but I could not quickly find a better solution - and it's also not _that_ bad.

Edit: correct link to the commit

  • Copy link
  • Flag this comment
  • Block
dtanzer
@dtanzer@social.devteams.at replied  ·  activity timestamp last week

Oh, yeah, some of the tests are now over-complicated. Should clean them up a little bit more. But not right now.

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login