HW impossibility?: “Create a rock paper scissors program in ruby WITHOUT using conditionals”

后端 未结 8 1879
我寻月下人不归
我寻月下人不归 2021-02-14 16:50

I\'m in an introductory software development class, and my homework is to create a rock paper scissors program that takes two arguments (rock, paper), etc, and returns the arg t

8条回答
  •  死守一世寂寞
    2021-02-14 17:31

    I don't know much about ruby, but I solved a problem like this long ago by using values for each one (eg, R = 1, P = 2, S=3).

    Actually, I just googled after thinking about that and someone solved the problem in python using an array.

提交回复
热议问题