arifikhsan / batu-gunting-kertas-nuxt

Rock Paper Scissors Game with Artificial Intellegence
http://rockpaperscissors-ai.now.sh/
97 stars 17 forks source link

paper and scissors is mixed up #2

Closed MartinMuzatko closed 4 years ago

MartinMuzatko commented 4 years ago

https://github.com/arifikhsan/batu-gunting-kertas-nuxt/blob/master/pages/index.vue#L81-L98

https://github.com/arifikhsan/batu-gunting-kertas-nuxt/blob/master/pages/index.vue#L274-L289

arifikhsan commented 4 years ago

Hi, could you explain what's wrong?

MartinMuzatko commented 4 years ago

When I choose paper, it chooses scissor for me. When I choose scissor, it chooses paper for me. Rock is fine.

rps

Here the function defines 2 as scissors, 3 as paper https://github.com/arifikhsan/batu-gunting-kertas-nuxt/blob/master/pages/index.vue#L274-L289

Here you use the wrong translations for the wrong numbers :) https://github.com/arifikhsan/batu-gunting-kertas-nuxt/blob/master/pages/index.vue#L81-L98

arifikhsan commented 4 years ago

wow good catch. i dont realize it at all 🎉

arifikhsan commented 4 years ago

fixed!