This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makefetchCall() { | |
fetch('...', {...}) | |
.then(res => { | |
if (!res.ok) { | |
throw Error({ message: 'Response with error', code: res.status }) | |
} | |
return res.json() | |
}) | |
.then(json => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lines = ` | |
101000111100 | |
000011111101 | |
011100000100 | |
100100010000 | |
. | |
. | |
. | |
`.trim().split('\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Board | |
class Cell | |
attr_reader :row, :column, :value | |
def initialize(row:, column:, value:) | |
@row = row | |
@column = column | |
@value = value | |
@marked = false | |
end |