Commit 8901f110 authored by Yannick Li's avatar Yannick Li
Browse files

Change grids

parent 268817ab
......@@ -23,7 +23,7 @@
*/
import React from 'react';
import { validInput } from '../constants.js'
import { validInput } from '../constants'
/**
* Interface for the properties of the Cell.
......
......@@ -25,7 +25,7 @@
import React from 'react';
import assert from 'assert';
import Cell from './Cell';
import { validInput, GRIDS } from '../constants.js'
import { validInput, GRIDS } from '../constants'
import { client } from '@concordant/c-client';
import Submit1Input from './Submit1Input';
......@@ -201,7 +201,7 @@ class Grid extends React.Component<IGridProps, IGridState> {
* @param gridNum Desired grid number.
*/
handleSubmit(gridNum: string) {
if (Number(gridNum) < 1 || Number(gridNum) > 46 || gridNum === this.state.gridNum) {
if (Number(gridNum) < 1 || Number(gridNum) > 100 || gridNum === this.state.gridNum) {
return;
}
let mvmap = this.props.collection.open("grid" + gridNum, "MVMap", false, function () {return});
......@@ -249,7 +249,7 @@ class Grid extends React.Component<IGridProps, IGridState> {
<div className="sudoku">
<div>Current grid : {this.state.gridNum}</div>
<Submit1Input inputName="Grid" onSubmit={this.handleSubmit.bind(this)} />
<div>Grid difficulty on scale of 1-46 (1 being the easier and 46 being the harder)</div>
<div>1-20: easy, 21-40: medium, 41-60: hard, 61-80: very-hard, 81-100: insame)</div>
<br />
<div><button onClick={this.reset.bind(this)}>Reset</button></div><br />
<div><button onClick={() => this.switchConnection()}>{this.state.isConnected ? "Disconnect" : "Connect"}</button></div><br />
......
......@@ -52,7 +52,7 @@ class Submit1Input extends React.Component<ISubmit1InputProps, ISubmit1InputStat
handleSubmit(event: any) {
event.preventDefault();
if (Number(this.state.value) >= 1 && Number(this.state.value) <= 46) {
if (Number(this.state.value) >= 1 && Number(this.state.value) <= 100) {
this.props.onSubmit(this.state.value);
}
}
......@@ -63,7 +63,7 @@ class Submit1Input extends React.Component<ISubmit1InputProps, ISubmit1InputStat
<label>
{this.props.inputName} :
<input type="number" value={this.state.value} onChange={this.handleChange}
min="1" max="46"/>
min="1" max="100"/>
</label>
<input type="submit" value={"Change " + this.props.inputName} />
</form>
......
export const validInput = new RegExp('^[1-9]$');
/**
* Grids generated using sudokutoolcollection.
* https://www.npmjs.com/package/sudokutoolcollection
*/
export const GRIDS : {[key: string]: string} = {
"1": "8354.721.4293.17..1675298437826.4.51514.32.76.9617...8..8..6132271..3684643218597",
"2": "..6.2.74..42.7..86175486293538694172..185743.4973128657192683548.4.3..27..374..18",
"3": "31.29.864...31.79292..481.58649.157315....928792..3641539...216678132459241..9387",
"4": ".962.8.7.314657928.8.9.45164...25.6976.4932819281...5.8723.16951495.283765378....",
"5": "42.8.713585.31.247.312548969176483523.8....1.2.51.3...592731...67348592.1.49..573",
"6": "18.43.79.56.792..4.9.581263871.54.36.5..7...132..19..7235148679948367..2.1.925348",
"7": ".5.9416731..786925...53214842.6.378.3..8.7462...2.453....1653945..4298179..378256",
"8": "2.9756.48548.9..76..7.84529873529614124637.859..4182377...4.86.4...6375.....7.49.",
"9": ".862.9.3437..462.94..35167.853762491...5138.7...984365.67.98..3938125746...63....",
"10": "1..9.3765...5..19339.7168246398542..7526314894812795365.31.794....4..3.....3..6..",
"11": "..617.29519263547857428.163258..3.1.613...58494751832.4.5..1.3.7.9.4..51..1......",
"12": ".3.7.14.9..136.....24895.6..97.43.5..45186..78639..124.125..6936.94.251835...9742",
"13": "578316924..3542817421789.5...5..7468286134579...865231.....8.4...2....8.8......92",
"14": "795362.8.164978...283145..98412.7..6..68.4...9.2651..8.17.83.....9.26.17.28719...",
"15": "691..5...2351.9....8..2.59116.2.8.5.523...1..4785136298.2...9..9468327153.7...28.",
"16": ".4.8.9....8.514......3.7.4.....46.2.834295.......38.94519673482376482951428951...",
"17": "2..9134..4.9.56...1...48....4..9.....1..3..4.9..184526351.69.72628375194794821...",
"18": "4265318977..942...1958764.3..7195...612784.35954263178.4.....89..................",
"19": ".31487259.8.3..41..4....8738935..647.7.94..2.124.7.395.......32.69...581.1.....64",
"20": "254986..7...1459.2169732....9.461....1...7.4342.358.91.71.2.............9428.35.6",
"21": ".8.3.....57....81..2.87....295438671164957382738.62594942.8.1...5........1.......",
"22": ".4..8.....18.3..9..6........5.86732.327195...68.3427..89...36.2.769285..23.6.49..",
"23": "923..8.6..68..4.7...76.928383...2.5.295..184.74...5.2.61...75..38...67.257.......",
"24": "........77.9.63.8....7.89..53.87.649....3.1288.....375...6.92..916327854......796",
"25": "2..496.5336957124.....3...9......521.1..254.6...61.38.....42..5..48....2...1.7.34",
"26": "1.279.5....6.........8.....671924385358167...429385....9....4...6.....5..146.9..3",
"27": ".....9.6..7.3..48........3.......84.469.38.7281...4.9......1.2.146..3.5.298675314",
"28": "4.3895.21...6123.4.1.374.85...7.8246.2..6.517....21.39............2......3......2",
"29": ".819462.5.9.7384164.621........9256.6..45.....5..67.....8.....1.2.6.1.9..........",
"30": ".2398..5....453...549.7....3..7958..854.1.......348..5.758.41...3.5...........5..",
"31": "284..7...7..8.2......4.18.......5........4........97..675..8...8927.31561.35269..",
"32": "....9..........8..14...2..7.95..7.....2.......81....65916875324874........3..9678",
"33": "5...1..8..7....9..............165823162...579385792......6...5..3.52..9..5.......",
"34": "....4.7.17.....5....2...38....4..21..2.....4...1....3.1.6..4..92....81.3839..547.",
"35": "698..4...1..5...4.574..3.2.4.5...7..96.....8.2873...1.3...96...7........8........",
"36": "...389..7..5761..47..542.......5.........34...........3.6.........8.5.464871.6...",
"37": ".5....3.6.7....491.......5..4...7..9.8....6..21.8.5734...3...6....6........9...43",
"38": "2936.8415...4.37......2.6.........3................8......673..748.15.........5.1",
"39": ".23.....9.6....2...8.......65........7..6...214.............9..........6296458731",
"40": "..845.6.26....75.4.5...29............16..572.............5........3..2......29.5.",
"41": "..8.............4........5............43.6.87...............5.1...5.48.928579.634",
"42": "...7.4.81............5....2..3..51.8.1...........1.....7......52.6.....9.....7316",
"43": "......9.....9....2.93.2.54..1.....65.........7.....2.....8..........38..987.1....",
"44": "......4.1......2........9.8......6.3.5.9.71.2.2...4....71....2....8......9.......",
"45": "....6.9..56....7..........6...348.7...4...8..........4....97....15..4............",
"46": "9.....7....5...6.8..8...2..2....6...6.....4.....4..3........5.2........3..2......"
}
\ No newline at end of file
export const validInput = new RegExp('^[1-9]$');
/**
* Grids generated using sudokutoolcollection.
* https://www.npmjs.com/package/sudokutoolcollection
*/
export const GRIDS : {[key: string]: string} = {
"1": "75941832646893275113267548957418693...63.48.582.75.1..687...5.33.15672..2..8.3617",
"2": ".87..51..14.8.75...5..1.8.72715..384469378215538142679.24953761.15684.23396721458",
"3": ".816593747453129686934781529325614878749236155167.4293.2..9..363.9.4..21...2.....",
"4": ".75.2..6.19.78.23..42.96...463912587729658.4.51847362925783149693.567812681249...",
"5": "......265.52.86739..7.5.1849.35.8472275934816.....2593741695328586321947329847651",
"6": "2548..1691396254878.64915324852..9169..5468733671892455..76.39.69.31.75...3...621",
"7": ".9573241.27184965348.61592.754.281361325648799683715425.61.7.94.1749...5...2....1",
"8": "4251968377693..54181375...235.86.419194235786678941.2524.5....39876132.453.4....8",
"9": "714628..5569431..2238975..16.75.4.131.57.3..6493162..8846359127351247..9972816..4",
"10": "57921648324.537169..348..2...1.62..4452371698..6.45.12..71582468146239..625794831",
"11": ".36.5.918.9..6.35.51..3946.375.2.6.984159627362937.1.5283645791954.1.836.67983524",
"12": ".58426..13.9715.681623984..6279541835...826798.163.5424732698152.58437......71324",
"13": "84631.27932179.658597...41376.9231.513.547896.5486.73248.279561.7915.38...5438...",
"14": "4681327..251947368379568412843721...597486123612395874.3..592.118.27....92..1...7",
"15": "129..6485638594127745821936.51.6837..76.538.1.8341765.594182763.176.52...62...51.",
"16": "9145276836.5.3821923861974..462958318513.4.62.29..6.5746.951...1.784.5.65.37.2194",
"17": "49.317.6513.659.74...4281932891645..3.4.7298.57.983.2....295348.23741659945836712",
"18": "485263197631978.25972154...71...29..86.59127.529.47.812.87195..357.26819196..5742",
"19": ".5682391729315.64887.49.53213.76.28.78....46.64..8..7.924678.5.568312794317945826",
"20": "86479251321.548796..7613.42..217....7..38..2.4..259..7378961254649825371125437968",
"21": "15927..43.27.3..193.6....72.3248.7.1..53172.6.71.2943.71385.9.4568...3272.47631..",
"22": "1457362..2869513.737982..16861.73.2579428563.5236198744...6....6...9.4..9...4....",
"23": ".12..589..34....51.85....2.471962.8539..51.74258..316.52763.9188.9..75361635..742",
"24": "756..321949.5728632839165741...976.86....19.7.79...3.19...6.73.3671.948....73.196",
"25": "1976853245384..9672647.....7495..6..8569..142312864795921358476...2........1..2..",
"26": "83.176925.....4781791..5463.576.38.9.63...5.74.97.1236.4..1769291..6.374672...1.8",
"27": ".49.31725.57.92.4.6124.79387849...5..6.5.4.7.5.178.3941..345..9.3....48.496278513",
"28": "9.3786.45......96365143982.37.542681568917432412.6.7592...7..9.1..69.27..9....31.",
"29": "..58271......314757..54.82.5...7.34.6493..7183271845...5.4.8937874293651...7.5284",
"30": "23.6958..79.8.2.5.8564719..3785.9...9123.85..46521..89.4978.2.5623...7985879.6...",
"31": "819735...364129.8....846139576294813931568...482317956..3.71..8.98.5...11...8....",
"32": ".8..316....1..68.3..68.71.4..2..8.17817..236536.715.28175683.49..8174536643..9781",
"33": "45361987278253469.916782.3..3...6....4...73166..341.....5.63.47.6..78..3374295168",
"34": "83.6715....9.857342.5.498...16754283527813496..3962.57.4..9...8..14286.5.58....42",
"35": "3.748.5..46597....8213564..15286....9.41.76..6785392145867.314221.64.7..74.21....",
"36": "654.732..391526847278914.35529341786816.5.3...3.68....9.5..8...18.49756.7....5..8",
"37": ".1.....2..642..37973249.5...86.2.74547386.192125947.3.6475.29..25...9...391684257",
"38": ".63.5.792594.268317..983.4.987162...1.58.4.6924653918.6..3.857.37.24.9164.......8",
"39": ".6.47.8.1.87.5..231528397467..5.368459..24.17.467...9.8..965172...241.3821..8.469",
"40": "52.7.6.839..3....63674815.9.3956.24..469.7835158...967.731....469583...24.267.398",
"41": "...6214.....549.3....783....3...5....2.8.43.9....378.....47218571435892.285196743",
"42": "..71963....1.3.....3..7...11..82.4.3...91...5.736541.23..2815..7..3.521951.749836",
"43": ".5...8..2.8.2.......2..68...186.....3248915...96....28149582...8.57.3291273169485",
"44": "8.3..54766957432817412.8........4...23.8.714..74..6...45..81.9...9572.141.74.....",
"45": ".3.195.4..75834....1..26...361289475.4.573.8.587461.23.239.8.1..5.6........3.2...",
"46": "1.96487.5..8.5........9.1.851.2893...9...458....5.....942815673..14..2597659238..",
"47": "375814269281.....7.9427.8..527149386418..792593..82.74.5..2.6.........9..........",
"48": "3654..2918742193659.13654.7...1......1.....5.489...17.536..1..92..6..51.14.95....",
"49": ".8574931..1.....5..9...5...1.29368.535.2..69.8695.4123....6253..2..5..6.536.9.28.",
"50": "3.9.6..8.6......7.41..5..6.1.6..5.9.2......5.5...7..1.9615437287..618935835927146",
"51": "..4.6.19.....4.58.1..75.634....8427.....3.94.41..7.8639.3.2.418.4..1.359..1493726",
"52": "7.1.5.984..81.4...3..9.71.694.63.578.3.8792.1.874..693....46.....6.93.1...3.18.69",
"53": ".6....4...7....6...1...69...2.45179664783915..9.627843.3.56.2.77.6.9.3.4.8...3569",
"54": "...28..5.5.976.42.76.5.319..483.571.12.8.6.3.97..2..6.29.........76...89836957.41",
"55": "4...2538...79.3..63.916.....3.47651.17.53.9...6.891473891...2...4.21985......86.1",
"56": "4.25.71.3951.43786.378..2..7.9.8..3..6..71.24..56.2.......2..59.7...4862..6.58417",
"57": "..9..7316..7...9546......82592371..8.63...29778429613597......13..7.54.94......73",
"58": "..2.46..9.5..39..2.96.217....5672...247983516.68415..7....9......9.6....623157984",
"59": "4162859377539612...293..1561928.65..6845...1.537...6....1......9.5..8.6.2.8......",
"60": ".69472.31.21385...543691...6571.8....1..47....845.6.1.4..819...1382.4......7..148",
"61": "...593..4....217..152.47..3..725.....8.714.....593......146.....9.18.....2.3794.1",
"62": "...17469272685941394.3..785...6...3....2...6...3....24...5...7........4.1..4...56",
"63": ".7.264391419..8672...719584...6...4....89..63...4.7.5......................976815",
"64": "......3..5.3..7.....7.......89...7.33..87.....75.2..89.5.23849..3.964..59427..836",
"65": "3..7654898.7.91.2.9.6.28..128..59.......348...6...7...1...7....6..84.......516..8",
"66": ".7.6............62..6.....9...47...89...2647...71.....7619.....5.4217386823564..7",
"67": "...........1......43.629.....98.2.45.....7.8.....35.296.4281.57.523....4.73594.61",
"68": "428.6.519....1.27...1825346....4...11.4.72..3.56138.2..1.29.83...................",
"69": "...549.8..84631...93.827....5.7.4......1...7....9...5.6..2.85....5416...4.837..62",
"70": ".1.49836596.723481.3..6.972.....78..3.....2.......274...6...1.7..3.765........6..",
"71": "1...4...7.....9..6......2.19172564838.....1.2234.7.5.9.4....9.8783...6.4......7.5",
"72": "643195782..1.....995..73461..5..1...3.....9161...3.....3..1.....1.......5..32.148",
"73": "7..84..9.1.8.2.467.......8.8..697....76...8.9.2..8.67..4...1.28.1...8345.8.....16",
"74": "83..6.....2.8..63..6.13..2.6.2...3..3..5...697..6.3..2...3...46573.46..1246.....3",
"75": "874219563.6.734.18....8..4.75.3...29......736.3.....85..7.23.9.6..1........8.....",
"76": "..9...3..2.8...1.............6...971.72..35464.567.832.231.....5....621...1.27453",
"77": "32....9..9..73.1...17.9634..69..7431....6.8........6...739...6.6..32.71.1..67...3",
"78": "...5........6..1.5..71..3.2475...6.12..4.68598963152....426......985..2....7..9..",
"79": "..3.41.9.9..3..418514......63.....4.7954...6....6....9.86.349.735.8.6124.........",
"80": "...9.4.....7...4..4.52.7..9.4.87.6..5..3.27.87896..23....4289....85..1....47...82",
"81": "..2.7.4..84........1..49...4......1..2.4.3..6......24.57..........7218542..5.....",
"82": "2.9.8..4........9.....9.......92.1...9........2.7....9...2..957..2.79...9..56381.",
"83": "81..67....47.......5.....73.2....5...8........9........7..3..6.439126785.6.......",
"84": "8.2...7....6.789......3.8.6.1385...7....12...25.7...8.......37.3....7..........4.",
"85": "....51.2.2..97.......68217.8..7..64..9.2.8751........8.......1................367",
"86": "4.9......23...5.69.85....4..........694378215.2........1...4..7....134...........",
"87": ".4583......2..73..7...1....5967241..32..8.......35..6.6..273.....................",
"88": "...2.86.1..............1.......84597...6.92..8497253.....8.6...4..1........54....",
"89": "2184536794.69..32....2..41.....7...4......................4..........14...4..9.83",
"90": "..9..............4..........4.781692298...5.1.6.2..48395.83..1....1...........8..",
"91": ".1.3......................7..19.6..5.7.....9..8.......165..8...843..5...79263.854",
"92": ".78.2.1....5.........3.....9.....48..4.8........546......2..9......6....164937528",
"93": ".3..87915.7..15..25..3..4787.5.2....6.......7329....41.........................2.",
"94": "......7.2..7692.....2847...75......1.2.9.5.....6...3...7.............8.7...7.8263",
"95": "936.....55216.89.3487.3.1622.8..4...6.........7...2.......................5....3.",
"96": ".8........47........2..5....7...8...418.39.76235.179..86.92..3...3...............",
"97": "1........6.2......8.......23........265379418479...2537.61.25....................",
"98": "....7549.5.9..6.78.7...956..........2.......4417..263.....9.........8..9...5....6",
"99": ".....2.3.....3..4............5628.1...43798.5...154......4.3.....9...3.1683......",
"100": "...8..9..........1....562..8..5.172..2.7..58....24819..13.82..94................."
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment