Comment

Comment by d0m

Pretty clean code! A small suggestion:

  cell.live = false if count < 2 or count > 3
  cell.live = true  if count == 3
Could become:

  cell.live = count < 2 or count > 3
  cell.live = count == 3
since it's a bit redundant to write "true" since it's already a boolean expression. It's a little bit like saying:

  if a == true:
    return true
  else:
    return false
instead of:

  return a // Agreed that a could be a "truth" value without being the real "true". Still:

  return !!a // With a hack
parent d0m 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton