Skip to content

Instantly share code, notes, and snippets.

View asubramanian08's full-sized avatar

Arjun Subramanian asubramanian08

View GitHub Profile
import random
bomb_count = []
revealed = []
BOMB_CHANCE = 0.3
BOMB = '*'
def reveal(px, py):
global revealed
@asubramanian08
asubramanian08 / Blackjack.py
Created December 3, 2022 13:28
Blackjack simulator in commandline
import random
def realTotal(player):
return min((21 - player[0]) / 10, player[1]) * 10 + player[0]
def moneyInput(prompt):
while True:
try:
ret = float(input(prompt))
if ret < 0:
raise ValueError
else:
@asubramanian08
asubramanian08 / IPEDS_Analysis.ipynb
Last active September 28, 2022 23:11
Analyzing the IPEDS dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asubramanian08
asubramanian08 / MovieLensDataAnalysis.ipynb
Last active September 24, 2022 00:38
Exploratory Data Analysis of the Movie Lens Dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asubramanian08
asubramanian08 / 2048
Last active July 26, 2022 04:56
Play a visual 2048 game using front end languages (incomplete)
NOTE: This file is used to name the gist.
@asubramanian08
asubramanian08 / PasswordManager
Last active July 26, 2022 04:57
Store and fetch (manage) all password using one universal password (incomplete)
NOTE: This file is used to name the gist.
@asubramanian08
asubramanian08 / MathExpression.py
Created July 25, 2022 22:08
Evaluate a math expression with order of operations
""" Evaluates a math expression with the correct order of operations. """
def editExpression(inputExpr):
""" Edit the math expression by removing spaces and enclosing it in parentheses. """
expression = "("
for ch in inputExpr:
if ch != ' ':
expression += ch
expression += ')'
@asubramanian08
asubramanian08 / SudokuSolver.cpp
Last active July 26, 2022 04:55
Solve any sudoku board through a brute force filling algorithm
#include <iostream>
#include <utility>
using namespace std;
// Arrays and macros
#define SIDE_LEN 9
bool rows[SIDE_LEN][SIDE_LEN] = {false};
bool cols[SIDE_LEN][SIDE_LEN] = {false};
bool boxes[SIDE_LEN][SIDE_LEN] = {false};
#define BLANK 0