Skip to content

Commit

Permalink
Fixed double quotation mark bug in font guessing game
Browse files Browse the repository at this point in the history
  • Loading branch information
timhaj committed May 1, 2024
1 parent d499533 commit bf537b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ document.body.appendChild(container);

function handle(selected: any): void {
let selectedFont: string = selected.style.fontFamily;
if (selectedFont == guessingFonts[fontToGuess]) {
if (selectedFont == guessingFonts[fontToGuess] || selectedFont.substring(1, selectedFont.length - 1) == guessingFonts[fontToGuess]) {
if (!gameWin) {
for (let i: number = 0; i < fontDiv.children.length; i++) {
let child: any = fontDiv.children[i];
Expand Down
2 changes: 1 addition & 1 deletion js/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ container.appendChild(element);
document.body.appendChild(container);
function handle(selected) {
let selectedFont = selected.style.fontFamily;
if (selectedFont == guessingFonts[fontToGuess]) {
if (selectedFont == guessingFonts[fontToGuess] || selectedFont.substring(1, selectedFont.length - 1) == guessingFonts[fontToGuess]) {
if (!gameWin) {
for (let i = 0; i < fontDiv.children.length; i++) {
let child = fontDiv.children[i];
Expand Down

0 comments on commit bf537b6

Please sign in to comment.