Skip to content

Commit

Permalink
Changed Grid size constraintns and resize state size
Browse files Browse the repository at this point in the history
  • Loading branch information
uonliaquat committed Feb 19, 2021
1 parent 51756cf commit b7e06f4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GridWorld/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

</head>
<body>
<div class="container my-4">
<div class="my-4 row align-items-center justify-content-center">
<div class="text-center">
<button id="default_btn" type="button" class="btn btn-light">Default</button>
<button id="brick_btn" type="button" class="btn btn-dark">Brick</button>
Expand Down
2 changes: 1 addition & 1 deletion GridWorld/state.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const STATE_SIZE = {WIDTH:70, HEIGHT:70};
const STATE_SIZE = {WIDTH:60, HEIGHT:60};
class State{
constructor(type, cordiates, position){
this.type = type;
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<div id="config">
<div class="form-outline form-white">
<label class="form-label" for="formWhite">No of rows</label>
<input type="number" id="rows" class="form-control" value="10" />
<input type="number" min="0" max="18" id="rows" class="form-control" value="10" />
<label class="form-label" for="formWhite">No of cols</label>
<input type="number" id="cols" class="form-control" value="10"/>
<input type="number" min="0" max="35" id="cols" class="form-control" value="10"/>
<button id="generate" class="btn btn-primary input-block-level form-control">Generate</button>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ var height = 0;
generate_btn.addEventListener("click", () => {
width = document.getElementById('cols').value;
height = document.getElementById('rows').value;
if(width > 20 || height > 20 || width < 0 || height < 0) return alert('Width and Height must be less than or equal to 20');
window.location.href = `/GridWorld/index.html?width=${width}&height=${height}`;
});
Binary file modified resources/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b7e06f4

Please sign in to comment.