Let's Have Some Fun with Game Of Life:& Learn to Think Functionally Along the Way Venkat Subramaniam

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2024
  • Game of Life is an intriguing game. At first look it looks simple, but as you look closer, it appears to be quite complex. How can we implement this game with different constraints, what are the constraints? Is it possible to use functional programming for this, to honor immutability? You see, it is intriguing. We will discuss the constraints, think about how we may be able to solve them, and along the way discover how functional programming can play a role. We will have a fully working program, using live coding, at the end of this session, to illustrate some nice ideas that will emerge from our discussions.
    For more on-demand content, visit: saltmarch.com/...

ความคิดเห็น • 3

  • @TheMrHueyFreeman
    @TheMrHueyFreeman 10 หลายเดือนก่อน +1

    the kid at 21:00😅 is super annoying

    • @smunro1983
      @smunro1983 3 หลายเดือนก่อน

      He forgot the first law of power: Never outshine the master.

  • @nikolasleontiou9962
    @nikolasleontiou9962 3 หลายเดือนก่อน

    To anyone interest , this is my solution
    static Set nextGeneration(List liveCells) {
    var cells = generateSignalsForCells(liveCells);
    return countSignals(cells)
    .entrySet()
    .stream()
    .filter(entry -> {
    var cell = entry.getKey();
    var count = entry.getValue();
    return count == 3 || (count == 2 && liveCells.contains(cell));
    }).map(Map.Entry::getKey)
    .collect(Collectors.toSet());
    }