+
+
TRIANTA
+
Function over form by design
-
-
Snake
-
-
-
Snake Head Location:
-
Food Location:
-
View Code
+
diff --git a/pages/completed/.htaccess b/pages/completed/.htaccess
new file mode 100644
index 0000000..717ec6f
--- /dev/null
+++ b/pages/completed/.htaccess
@@ -0,0 +1 @@
+DirectoryIndex index.html
diff --git a/pages/completed/index.html b/pages/completed/index.html
new file mode 100644
index 0000000..fd6d589
--- /dev/null
+++ b/pages/completed/index.html
@@ -0,0 +1,61 @@
+
+
+
+
+
Trianta
+
+
+
+
+
+
TRIANTA
+
Function over form by design
+
+
+
Completed Projects
+
+
+
+
+
+
Game Over
+
+
+
+
+
+
Pong
+
Left Paddle Height:
+
Right Paddle Height:
+
View Code
+
+
+
+
+
+
+
+
+
Snake
+
+ Adjust game size -- Width:
+
+ Height:
+
+
+
Snake Head Location:
+
Food Location:
+
View Code
+
+
+
+
+
diff --git a/pages/contact/.htaccess b/pages/contact/.htaccess
new file mode 100644
index 0000000..717ec6f
--- /dev/null
+++ b/pages/contact/.htaccess
@@ -0,0 +1 @@
+DirectoryIndex index.html
diff --git a/pages/contact/index.html b/pages/contact/index.html
new file mode 100644
index 0000000..f6bc55c
--- /dev/null
+++ b/pages/contact/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+
Trianta
+
+
+
+
+
+
TRIANTA
+
Function over form by design
+
+
+
Contact Methods
+
E-mail: gregcraw2001@gmail.com
+
Discord: trianta
+
+
+
diff --git a/pages/current/.htaccess b/pages/current/.htaccess
new file mode 100644
index 0000000..717ec6f
--- /dev/null
+++ b/pages/current/.htaccess
@@ -0,0 +1 @@
+DirectoryIndex index.html
diff --git a/pages/current/index.html b/pages/current/index.html
new file mode 100644
index 0000000..5ebb764
--- /dev/null
+++ b/pages/current/index.html
@@ -0,0 +1,38 @@
+
+
+
+
+
Trianta
+
+
+
+
+
+
TRIANTA
+
Function over form by design
+
+
+
Current Personal Projects
+
+
Wrench
+
Description: A simple application to handle all of your Linux configuration needs.
+
Language: C++26
+
Tools: CMake
+
Frameworks: Qt6
+
View Repository
+
+
+
Synopsis
+
Description: A markdown repository containing details and changes of servers I maintain.
+
View Repository
+
+
+
+
diff --git a/pages/other/.htaccess b/pages/other/.htaccess
new file mode 100644
index 0000000..717ec6f
--- /dev/null
+++ b/pages/other/.htaccess
@@ -0,0 +1 @@
+DirectoryIndex index.html
diff --git a/pages/other/index.html b/pages/other/index.html
new file mode 100644
index 0000000..0552553
--- /dev/null
+++ b/pages/other/index.html
@@ -0,0 +1,68 @@
+
+
+
+
+
Trianta
+
+
+
+
+
+
TRIANTA
+
Function over form by design
+
+
+
Other Projects
+
+
+
+
Cloudcare
+
Description: A sample repository that uses downloaded .bed files to train a model on DNA using PyTorch.
+
View Repository
+
Languages: Python, Bash
+
Libraries: PyTorch
+
Tools: Conda
+
+
+
N-Queens
+
Description: The N-Queens problem recreated in C++ which gets solved using a Genetic Algorithm.
+
View Repository
+
Language: C++11
+
Tools: CMake
+
+
+
+
diff --git a/src/snake.ts b/src/snake.ts
index 236ac7d..9563c75 100644
--- a/src/snake.ts
+++ b/src/snake.ts
@@ -158,7 +158,7 @@ class SnakeCore {
else if (isBitSet(g_snake.board[i][j], BoardState.FOOD))
g_snake.context.fillStyle = "red";
else
- g_snake.context.fillStyle = "black";
+ continue;
g_snake.context.fillRect(j * g_snake.grid, i * g_snake.grid, g_snake.grid, g_snake.grid);
}
}
@@ -169,6 +169,21 @@ class SnakeCore {
document.getElementById("snakeHead").innerHTML = "x: " + this.body[this.body.length - 1].x + " y: " + this.body[this.body.length - 1].y;
document.getElementById("snakeFood").innerHTML = "x: " + this.food.x + " y: " + this.food.y ;
}
+
+ // Update width and height from page to match game
+ getPageNumbers() {
+ let specifiedWidth = parseInt((document.getElementById("snakeWidth") as HTMLInputElement).value);
+ let specifiedHeight = parseInt((document.getElementById("snakeHeight") as HTMLInputElement).value);
+ if (this.width == specifiedWidth && this.height == specifiedHeight)
+ return false;
+ this.width = specifiedWidth;
+ this.height = specifiedHeight;
+ while (this.height > this.board.length)
+ this.board.push(new Array(this.width));
+ this.canvas.setAttribute("width", String(specifiedWidth * this.grid));
+ this.canvas.setAttribute("height", String(specifiedHeight * this.grid));
+ return true;
+ }
}
class Bot {
@@ -270,7 +285,7 @@ const g_snakebot: Bot = new Bot();
// game loop
function snakeloop() {
// Reset of needed
- if (g_snake.gameover)
+ if (g_snake.gameover || g_snake.getPageNumbers())
g_snake.reset();
// Simulate movement of snake