Skip to content

Commit

Permalink
Fix spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
j-m committed Nov 15, 2020
1 parent 39b492f commit 79863e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "word-guess",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"main": "src/index.tsx",
"homepage": "./",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Playing/Lives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ interface LivesProps {
const Lives: React.FunctionComponent<LivesProps> = (props: LivesProps) => {
return (
<span id="lives">
{ [...Array(props.remaining)].map((e, i) => <></> ) }
{ [...Array(props.count - props.remaining)].map((e, i) => <></> ) }
{ [...Array(props.remaining)].map((e, i) => <span key={'remaining'+i}></span> ) }
{ [...Array(props.count - props.remaining)].map((e, i) => <span key={'used'+i}></span> ) }
</span>
)
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/Start/StartForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function seed(word: string) {
let seed = 0
Object.values(word.split("")).forEach(letter => {
if (letter === " ") {
seed += BASE
seed += 0
} else {
seed += letter.charCodeAt(0) - 65 + 1
}
Expand All @@ -23,8 +23,7 @@ function word(seed: number) {
seed /= BASE
seed = Math.floor(seed)
const letter: number = seed % BASE
console.log(letter)
if (letter === BASE) {
if (letter === 0) {
word += ' '
} else {
word += String.fromCharCode(letter + 65 - 1)
Expand Down

0 comments on commit 79863e4

Please sign in to comment.