Skip to content

Instantly share code, notes, and snippets.

View svineet's full-sized avatar

Sai Vineet svineet

View GitHub Profile
@svineet
svineet / tic_tac_toe_solved.py
Last active May 20, 2020 03:32
A program that solves tic tac toe using the Minimax algorithm. Can defeat or draw always.
import time
import sys
print "Maximizer is X and Minimizer O"
class Position:
def __init__(self, parent_):
self.parent = parent_
self.children = []
self.best_eval = []
from bisect import bisect_left, bisect_right
class COVIDPopulation:
def __init__(self, N, K):
"""
K is the number of infected persons in N number of people.
It's not a percentage.
"""
self.N = N
import math
DEBUG = False
def generate_input_sample(params):
population = COVIDPopulation(params["N"], params["K"])
return population
@svineet
svineet / README.txt
Created November 16, 2021 10:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS