Skip to content

Commit 0924094

Browse files
Merge branch 'main' into fix/cross-site-scripting
2 parents 957673d + b72df8f commit 0924094

42 files changed

Lines changed: 5034 additions & 1515 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,20 @@ These standalone Python project files do not have a browser counterpart yet and
446446
<sub><b>@Reaper-ai</b></sub>
447447
</a>
448448
</td>
449+
<td align="center" width="120">
450+
<a href="https://github.com/Ridima28">
451+
<img src="https://github.com/Ridima28.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Ridima28" /><br />
452+
<sub><b>@Ridima28</b></sub>
453+
</a>
454+
</td>
455+
</tr>
456+
<tr>
449457
<td align="center" width="120">
450458
<a href="https://github.com/Sanjhivvarshan-b-s">
451459
<img src="https://github.com/Sanjhivvarshan-b-s.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Sanjhivvarshan-b-s" /><br />
452460
<sub><b>@Sanjhivvarshan-b-s</b></sub>
453461
</a>
454462
</td>
455-
</tr>
456-
<tr>
457463
<td align="center" width="120">
458464
<a href="https://github.com/SathvikaTalari">
459465
<img src="https://github.com/SathvikaTalari.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="SathvikaTalari" /><br />
@@ -484,14 +490,14 @@ These standalone Python project files do not have a browser counterpart yet and
484490
<sub><b>@Siddh2024</b></sub>
485491
</a>
486492
</td>
493+
</tr>
494+
<tr>
487495
<td align="center" width="120">
488496
<a href="https://github.com/Sparshjoshi-iit">
489497
<img src="https://github.com/Sparshjoshi-iit.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Sparshjoshi-iit" /><br />
490498
<sub><b>@Sparshjoshi-iit</b></sub>
491499
</a>
492500
</td>
493-
</tr>
494-
<tr>
495501
<td align="center" width="120">
496502
<a href="https://github.com/Sreekuttan-007">
497503
<img src="https://github.com/Sreekuttan-007.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Sreekuttan-007" /><br />
@@ -522,14 +528,14 @@ These standalone Python project files do not have a browser counterpart yet and
522528
<sub><b>@Tiago-Vier-Preto</b></sub>
523529
</a>
524530
</td>
531+
</tr>
532+
<tr>
525533
<td align="center" width="120">
526534
<a href="https://github.com/Vaishnavisatle2105">
527535
<img src="https://github.com/Vaishnavisatle2105.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Vaishnavisatle2105" /><br />
528536
<sub><b>@Vaishnavisatle2105</b></sub>
529537
</a>
530538
</td>
531-
</tr>
532-
<tr>
533539
<td align="center" width="120">
534540
<a href="https://github.com/Vanshikakhasat">
535541
<img src="https://github.com/Vanshikakhasat.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="Vanshikakhasat" /><br />
@@ -560,14 +566,14 @@ These standalone Python project files do not have a browser counterpart yet and
560566
<sub><b>@advikdivekar</b></sub>
561567
</a>
562568
</td>
569+
</tr>
570+
<tr>
563571
<td align="center" width="120">
564572
<a href="https://github.com/anujsharma8d">
565573
<img src="https://github.com/anujsharma8d.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="anujsharma8d" /><br />
566574
<sub><b>@anujsharma8d</b></sub>
567575
</a>
568576
</td>
569-
</tr>
570-
<tr>
571577
<td align="center" width="120">
572578
<a href="https://github.com/artic2702">
573579
<img src="https://github.com/artic2702.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="artic2702" /><br />
@@ -598,14 +604,20 @@ These standalone Python project files do not have a browser counterpart yet and
598604
<sub><b>@ayushyadav0707</b></sub>
599605
</a>
600606
</td>
607+
</tr>
608+
<tr>
609+
<td align="center" width="120">
610+
<a href="https://github.com/basantnema31">
611+
<img src="https://github.com/basantnema31.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="basantnema31" /><br />
612+
<sub><b>@basantnema31</b></sub>
613+
</a>
614+
</td>
601615
<td align="center" width="120">
602616
<a href="https://github.com/bhavyapandiya29">
603617
<img src="https://github.com/bhavyapandiya29.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="bhavyapandiya29" /><br />
604618
<sub><b>@bhavyapandiya29</b></sub>
605619
</a>
606620
</td>
607-
</tr>
608-
<tr>
609621
<td align="center" width="120">
610622
<a href="https://github.com/codewithakshyaaa">
611623
<img src="https://github.com/codewithakshyaaa.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="codewithakshyaaa" /><br />
@@ -630,6 +642,8 @@ These standalone Python project files do not have a browser counterpart yet and
630642
<sub><b>@dhruvpatel16120</b></sub>
631643
</a>
632644
</td>
645+
</tr>
646+
<tr>
633647
<td align="center" width="120">
634648
<a href="https://github.com/gatiksolanki13-netizen">
635649
<img src="https://github.com/gatiksolanki13-netizen.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="gatiksolanki13-netizen" /><br />
@@ -642,8 +656,6 @@ These standalone Python project files do not have a browser counterpart yet and
642656
<sub><b>@iamprasoon2006-cell</b></sub>
643657
</a>
644658
</td>
645-
</tr>
646-
<tr>
647659
<td align="center" width="120">
648660
<a href="https://github.com/itsdakshjain">
649661
<img src="https://github.com/itsdakshjain.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="itsdakshjain" /><br />
@@ -668,6 +680,8 @@ These standalone Python project files do not have a browser counterpart yet and
668680
<sub><b>@jyotish6699</b></sub>
669681
</a>
670682
</td>
683+
</tr>
684+
<tr>
671685
<td align="center" width="120">
672686
<a href="https://github.com/kumudasrip">
673687
<img src="https://github.com/kumudasrip.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="kumudasrip" /><br />
@@ -680,8 +694,6 @@ These standalone Python project files do not have a browser counterpart yet and
680694
<sub><b>@madhavcodes25</b></sub>
681695
</a>
682696
</td>
683-
</tr>
684-
<tr>
685697
<td align="center" width="120">
686698
<a href="https://github.com/mahi-8758">
687699
<img src="https://github.com/mahi-8758.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="mahi-8758" /><br />
@@ -706,6 +718,8 @@ These standalone Python project files do not have a browser counterpart yet and
706718
<sub><b>@n1o5</b></sub>
707719
</a>
708720
</td>
721+
</tr>
722+
<tr>
709723
<td align="center" width="120">
710724
<a href="https://github.com/nene-hana">
711725
<img src="https://github.com/nene-hana.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="nene-hana" /><br />
@@ -718,8 +732,6 @@ These standalone Python project files do not have a browser counterpart yet and
718732
<sub><b>@nimkarprachi17</b></sub>
719733
</a>
720734
</td>
721-
</tr>
722-
<tr>
723735
<td align="center" width="120">
724736
<a href="https://github.com/nishtha-agarwal-211">
725737
<img src="https://github.com/nishtha-agarwal-211.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="nishtha-agarwal-211" /><br />
@@ -744,6 +756,8 @@ These standalone Python project files do not have a browser counterpart yet and
744756
<sub><b>@parulpaliwal01</b></sub>
745757
</a>
746758
</td>
759+
</tr>
760+
<tr>
747761
<td align="center" width="120">
748762
<a href="https://github.com/pragya-manna">
749763
<img src="https://github.com/pragya-manna.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="pragya-manna" /><br />
@@ -756,8 +770,6 @@ These standalone Python project files do not have a browser counterpart yet and
756770
<sub><b>@prasad-0007</b></sub>
757771
</a>
758772
</td>
759-
</tr>
760-
<tr>
761773
<td align="center" width="120">
762774
<a href="https://github.com/priya05-git">
763775
<img src="https://github.com/priya05-git.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="priya05-git" /><br />
@@ -782,6 +794,8 @@ These standalone Python project files do not have a browser counterpart yet and
782794
<sub><b>@rishit537</b></sub>
783795
</a>
784796
</td>
797+
</tr>
798+
<tr>
785799
<td align="center" width="120">
786800
<a href="https://github.com/sakshicoded1111">
787801
<img src="https://github.com/sakshicoded1111.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="sakshicoded1111" /><br />
@@ -794,8 +808,6 @@ These standalone Python project files do not have a browser counterpart yet and
794808
<sub><b>@samarthchawla2005</b></sub>
795809
</a>
796810
</td>
797-
</tr>
798-
<tr>
799811
<td align="center" width="120">
800812
<a href="https://github.com/sanzzzz-g">
801813
<img src="https://github.com/sanzzzz-g.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="sanzzzz-g" /><br />
@@ -814,6 +826,14 @@ These standalone Python project files do not have a browser counterpart yet and
814826
<sub><b>@shimonenator</b></sub>
815827
</a>
816828
</td>
829+
<td align="center" width="120">
830+
<a href="https://github.com/shreyasarote7717-cyber">
831+
<img src="https://github.com/shreyasarote7717-cyber.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="shreyasarote7717-cyber" /><br />
832+
<sub><b>@shreyasarote7717-cyber</b></sub>
833+
</a>
834+
</td>
835+
</tr>
836+
<tr>
817837
<td align="center" width="120">
818838
<a href="https://github.com/shreyasgawande19">
819839
<img src="https://github.com/shreyasgawande19.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="shreyasgawande19" /><br />
@@ -832,8 +852,6 @@ These standalone Python project files do not have a browser counterpart yet and
832852
<sub><b>@snehacodes-2906</b></sub>
833853
</a>
834854
</td>
835-
</tr>
836-
<tr>
837855
<td align="center" width="120">
838856
<a href="https://github.com/snehanair-486">
839857
<img src="https://github.com/snehanair-486.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="snehanair-486" /><br />
@@ -852,6 +870,8 @@ These standalone Python project files do not have a browser counterpart yet and
852870
<sub><b>@sujitsingh8</b></sub>
853871
</a>
854872
</td>
873+
</tr>
874+
<tr>
855875
<td align="center" width="120">
856876
<a href="https://github.com/tanishkakora">
857877
<img src="https://github.com/tanishkakora.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="tanishkakora" /><br />
@@ -870,8 +890,6 @@ These standalone Python project files do not have a browser counterpart yet and
870890
<sub><b>@vedansht2211</b></sub>
871891
</a>
872892
</td>
873-
</tr>
874-
<tr>
875893
<td align="center" width="120">
876894
<a href="https://github.com/vedika76">
877895
<img src="https://github.com/vedika76.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="vedika76" /><br />
@@ -890,6 +908,8 @@ These standalone Python project files do not have a browser counterpart yet and
890908
<sub><b>@vivekCS007</b></sub>
891909
</a>
892910
</td>
911+
</tr>
912+
<tr>
893913
<td align="center" width="120">
894914
<a href="https://github.com/yuvraj-k-singh">
895915
<img src="https://github.com/yuvraj-k-singh.png?size=100" width="100" height="100" style="border-radius:50%; border:2px solid #555;" alt="yuvraj-k-singh" /><br />
@@ -898,6 +918,9 @@ These standalone Python project files do not have a browser counterpart yet and
898918
</td>
899919
<td width="120"></td>
900920
<td width="120"></td>
921+
<td width="120"></td>
922+
<td width="120"></td>
923+
<td width="120"></td>
901924
</tr>
902925
</table>
903926
<!-- CONTRIBUTORS_END -->

games/Dots-Boxes-AI/README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# 🔲 Dots & Boxes AI - Advanced Version
2+
3+
An advanced, beautifully colorized terminal-based implementation of the classic **Dots & Boxes** pen-and-paper game. Written in pure Python, it supports both local two-player matches and matches against a smart heuristic AI with three distinct difficulty levels.
4+
5+
---
6+
7+
## 🚀 Features
8+
9+
- 🎨 **Vibrant Terminal Styling**: Uses ANSI color escape codes for rendering player blocks, lines, points, and turns in eye-catching colors (Blue, Red, Yellow, Cyan, Green).
10+
- 👥 **Multiple Game Modes**:
11+
- **Player vs Player**: Battle locally against a friend.
12+
- **Player vs AI**: Pit your skills against a computer opponent.
13+
- 🧠 **Smart AI Opponent**: Features three AI levels utilizing custom decision-making heuristics:
14+
- 🟢 **Easy**: Makes completely random moves.
15+
- 🟡 **Intermediate**: Prioritizes completing a box and avoids leaving dangerous 3-sided boxes that would allow the player to score.
16+
- 🔴 **Hard**: Scores all available moves dynamically, prioritizing game winning configurations, blocking player gains, and positioning itself strategically.
17+
- 📏 **Custom Board Sizes**: Play on boards ranging from `2x2` up to `8x8` dots.
18+
- ⚙️ **Accurate Ruleset**: Completing a box grants the scoring player an immediate **extra turn**!
19+
- 🛡️ **Robust Validation**: Built-in protections against out-of-bounds coordinates, duplicate moves, invalid choices, and negative inputs.
20+
21+
---
22+
23+
## 🛠️ Requirements
24+
25+
- **Python 3.x**
26+
- No external libraries are needed (uses standard Python library built-in modules: `random`, `time`).
27+
- *Note: Works best in terminal environments that support ANSI color output.*
28+
29+
---
30+
31+
## ▶️ How to Run
32+
33+
1. Navigate to the game directory:
34+
```bash
35+
cd games/Dots-Boxes-AI
36+
```
37+
2. Run the script:
38+
```bash
39+
python Dots-Boxes-AI.py
40+
```
41+
42+
---
43+
44+
## 🎮 Gameplay Guide
45+
46+
### Objective
47+
Draw lines between adjacent dots on the grid. When a player draws the fourth line closing a `1x1` box, they score a point and earn another turn. The player with the most boxes filled when no more lines can be drawn wins!
48+
49+
### Playing a Turn
50+
1. The board is printed showing dots (``), drawn horizontal lines (`━━`), drawn vertical lines (``), and completed boxes (``).
51+
2. Input the line direction: `h` for horizontal or `v` for vertical.
52+
3. Input the **Row** and **Column** coordinates of the line:
53+
- For **Horizontal** lines: Row range is `0 to size`, Col range is `0 to size-1`.
54+
- For **Vertical** lines: Row range is `0 to size-1`, Col range is `0 to size`.
55+
56+
---
57+
58+
## 📸 Sample Board Render
59+
60+
```text
61+
• • •
62+
┃■ ┃
63+
•━━• •
64+
65+
• •━━•
66+
```
67+
68+
*Note: In the actual terminal, the dots, lines, and boxes are dynamically colored blue for Player 1 and red for Player 2/AI.*
69+
70+
---
71+
72+
## 📁 File Structure
73+
74+
```text
75+
Dots-Boxes-AI/
76+
├── Dots-Boxes-AI.py
77+
└── README.md
78+
```
79+
80+
---
81+
82+
## 👤 Author
83+
84+
Contributed as part of GSSoC (GirlScript Summer of Code).
85+
Repository: [python-mini-project](https://github.com/steam-bell-92/python-mini-project)

0 commit comments

Comments
 (0)