Changeset View
Changeset View
Standalone View
Standalone View
src/activities/memory/memory.js
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 48 | function initLevel() { | |||
---|---|---|---|---|---|
65 | cardLeft = nbOfPair * 2 | 65 | cardLeft = nbOfPair * 2 | ||
66 | 66 | | |||
67 | // Check the provided dataset has enough data | 67 | // Check the provided dataset has enough data | ||
68 | var maxData = Math.max( | 68 | var maxData = Math.max( | ||
69 | images ? images.length : 0, | 69 | images ? images.length : 0, | ||
70 | sounds ? sounds.length : 0, | 70 | sounds ? sounds.length : 0, | ||
71 | texts ? texts.length : 0) | 71 | texts ? texts.length : 0) | ||
72 | 72 | | |||
73 | if(rows * columns > maxData) { | 73 | if(rows * columns > maxData * 2) { | ||
jjazeix: extra space added | |||||
dekumar: I have fixed this on my branch in a commit. | |||||
echarruau: I still see it, we need to find a way to see your corrections | |||||
74 | console.log("ERROR: Memory dataset does not have enough data pairs at level ", | 74 | console.log("ERROR: Memory dataset does not have enough data pairs at level ", | ||
75 | currentLevel + 1) | 75 | currentLevel + 1) | ||
76 | return | 76 | return | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | // Create a list of indexes for the shuffling | 79 | // Create a list of indexes for the shuffling | ||
80 | // This way we can keep the 3 lists in sync | 80 | // This way we can keep the 3 lists in sync | ||
81 | var shuffleIds = [] | 81 | var shuffleIds = [] | ||
▲ Show 20 Lines • Show All 183 Lines • Show Last 20 Lines |
extra space added