Skip to content

Instantly share code, notes, and snippets.

View alankrantas's full-sized avatar

Alan Wang alankrantas

View GitHub Profile
N = 8 # 8 queens on 8x8 board
import time
def verifyPos(newColPos, rowPos):
for colPos in range(newColPos):
if queens[colPos] == rowPos or abs(colPos - newColPos) == abs(queens[colPos] - rowPos):
return False
return True
@alankrantas
alankrantas / wator.py
Last active February 15, 2025 08:15
Wa-Tor - using Python and Pygame
'''
Wa-Tor
https://en.wikipedia.org/wiki/Wa-Tor
This version utilizes 1 list and 2 deques to achieve O(n) complexity.
Install Pygame:
```
pip install pygame
```
@alankrantas
alankrantas / conway_game_of_life.py
Last active February 14, 2025 13:19
Conway's Game of Life - using Python and Pygame
'''
Conway's Game of Life
Install Pygame:
```
pip install pygame
```
'''
# game configuration
@alankrantas
alankrantas / echo.yaml
Last active December 24, 2024 04:43
Single K8S manifest for deploying echo pods, services and ingress
# Using minikube:
#
# ------------------------------
# minikube start
# minikube dashboard
# minikube addons enable ingress
# kubectl apply -f echo.yaml
# minikube tunnel --cleanup
# kubectl delete -f echo.yaml
# minikube stop