Skip to content

Commit 4cce16f

Browse files
committed
Feature: Add Reverse Hangman implementation to web app
1 parent cef0fd5 commit 4cce16f

5 files changed

Lines changed: 659 additions & 1 deletion

File tree

39.5 KB
Loading

web-app/generate_banners.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,18 @@ def draw_o(ox, oy):
397397
v_draw.text((x, y), sample_nums[i][j], fill=color_accent, anchor="mm", font=font_title)
398398
# Draw operation symbol
399399
v_draw.text((400, 280), "×", fill=color_accent, anchor="mm", font=font_title)
400-
400+
elif "reverse" in n_lower or "hangman" in n_lower:
401+
# AI brain + hangman gallows
402+
cx, cy = 400, 225
403+
# Gallows
404+
v_draw.line([(250, 350), (400, 350)], fill=color_accent, width=4)
405+
v_draw.line([(320, 350), (320, 120)], fill=color_accent, width=4)
406+
v_draw.line([(320, 120), (450, 120)], fill=color_accent, width=4)
407+
v_draw.line([(450, 120), (450, 150)], fill=color_accent, width=2)
408+
# AI brain/robot icon
409+
v_draw.ellipse([cx-30, cy-30, cx+30, cy+30], outline=color_accent, width=3)
410+
v_draw.ellipse([cx-15, cy-15, cx+15, cy+15], outline=color_accent, width=2)
411+
v_draw.text((cx, cy), "AI", fill=color_accent, anchor="mm")
401412
elif "unit converter" in n_lower:
402413
cx, cy = 400, 225
403414

@@ -522,6 +533,7 @@ def draw_o(ox, oy):
522533
("Spot the Difference", "games", "spot-the-difference.webp"),
523534
("Productive Pet", "utilities", "productive-pet.webp"),
524535
("Progress Tracker", "utilities", "progress-tracker.webp"),
536+
("Reverse Hangman", "games", "reverse-hangman.webp"),
525537

526538
# MATH
527539
("AP/GP/AGP/HP Recognizer", "math", "progression-recognizer.webp"),

web-app/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ <h3>Legal</h3>
876876
<script defer src="js/projects/resume-analyzer.js"></script>
877877
<script src="js/projects/caesar-cipher.js"></script>
878878
<script src="js/projects/matrix-calculator.js"></script>
879+
<script src="js/projects/reverse-hangman.js"></script>
879880
<script defer src="js/projects/unit-converter.js"></script>
880881
<script defer src="js/projects.js"></script>
881882
<script defer src="js/cm-editor.js"></script>
@@ -1079,6 +1080,13 @@ <h3>Legal</h3>
10791080
desc: "Add, subtract, multiply, transpose, determinant, rank, inverse",
10801081
tags: "math,matrix,algebra,calculator",
10811082
},
1083+
{
1084+
project: "reverse-hangman",
1085+
title: "Reverse Hangman",
1086+
category: "games",
1087+
desc: "Computer tries to guess your secret word using AI logic",
1088+
tags: "game,hangman,ai,word,guessing",
1089+
},
10821090
{
10831091
project: "coordinate-polar-transform",
10841092
title: "Coordinate Transform",

web-app/js/projects.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function getProjectHTML(projectName) {
2424
'nqueens' : getNQueensHTML(),
2525
'matrix-calculator': () => getMatrixCalculatorHTML(),
2626
'unit-converter': getUnitConverterHTML(),
27+
'reverse-hangman': () => getReverseHangmanHTML
2728
};
2829

2930
return projects[projectName] || '<h2>Project Coming Soon!</h2>';
@@ -52,6 +53,7 @@ function initializeProject(projectName) {
5253
'nqueens' : initNQueens(),
5354
'matrix-calculator': initMatrixCalculator,
5455
'unit-converter':initUnitConverter,
56+
'reverse-hangman': initReverseHangman
5557
};
5658

5759
if (initializers[projectName]) {

0 commit comments

Comments
 (0)