Search code examples
red-lang

How to increment element of block after found element?


Given player-choices: ["rock" 0 "paper" 0 "scissors" 0]

How could I increment the value after "paper" in this block by searching for "paper"?


Solution

  • >> player-choices/("paper"): player-choices/("paper") + 1
    == 1