itertools-ts icon indicating copy to clipboard operation
itertools-ts copied to clipboard

Implement random.rockPaperScissors()

Open Smoren opened this issue 10 months ago • 2 comments

Generate random rock-paper-scissors hands. Return values: "rock", "paper", "scissors".

If optional param repetitions not given then iterate infinitely.

function *rockPaperScissors(repetitions?: number): Iterable<"rock" | "paper" | "scissors">

PHP implementation example

Needs to be implemented:

  • random.rockPaperScissors()
  • random.rockPaperScissorsAsync()
  • Stream.rockPaperScissors()
  • AsyncStream.rockPaperScissors()

Smoren avatar Feb 09 '25 12:02 Smoren

hi @Smoren can you assign this issue to me i can try

eshant742 avatar Feb 10 '25 16:02 eshant742

Hi @eshant742! Done :)

Smoren avatar Feb 11 '25 09:02 Smoren