Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding numbered arrays for each dice #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ const woodenBackground = require('./Images/woodBackground.png')
const switchOn = require('./Images/switchon.png')
const switchOff = require('./Images/switchoff.png')

//Dice arrays
Copy link
Contributor

@greenervigil greenervigil Sep 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create a util function that will do this for us in a cleaner way. It can take in the number if sides as a parameter to the function and return an array.

const d4Arr = [1,2,3,4]
const d6Arr = [1,2,3,4,5,6]
const d8Arr= [1,2,3,4,5,6,7,8]
const d10Arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const d12Arr = [1,2,3,4,5,6,7,8,9,10,11,12]
const d20Arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]


// Expanding Dice Tray Component
const ExpandedDice = (props) => {
return(
Expand Down