Comment by eru
2 days ago
You could have a big pattern-match statement for Rock, Scissors, Paper and it would still be readable (in a language that supports these things like eg Rust).
The circular list seems a bit too cute for me. Sure, it's possible, but seems like overkill.
If you have to do a bunch of list manipulation yourself sure but most scripting languages make these things trivial.
Heck, you could easily write it using Terraform built-in functions.
What do you mean by 'list' in this case? Python, for example, has a list data structure, but it's different from what C folks would naturally think of when you say 'list'.