cmneal26 / Tech-Writing-Project

Class repository
2 stars 1 forks source link

Add function selectRandomOpponent(opponents) to the inline javascript on the 'Kids' #47

Closed ghost closed 2 years ago

ghost commented 2 years ago

Since each game will have a new and random opponent from an array of Opponent objects, we need a function that will select a random opponent.

calling the function with some input: selectRandomOpponents([{name: "Nighteyes"}, {name: "Simba"}]) // const randomValue = 1 // selectRandomOpponents()[1] == Simba

return value (output): Simba

conclusion: opponent - Simba

ghost commented 2 years ago

You you got this one, Claire.

cmneal26 commented 2 years ago

I'll work on it tonight!

ghost commented 2 years ago

No hurry, whenever you have time. If you're not sure where to place it, we can talk about it in that 10 min or whatever period tomorrow (tuesday) where we catch up.