This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module App | |
open Elmish | |
open Elmish.React | |
open Feliz | |
type State = | |
{ Username: string | |
Password: string | |
LoggedIn: bool } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> Executing task: C:\Users\morga\.platformio\penv\Scripts\platformio.exe run < | |
Processing uno (platform: atmelavr; board: uno; framework: arduino) | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
Verbose mode can be enabled via `-v, --verbose` option | |
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html | |
PLATFORM: Atmel AVR (3.4.0) > Arduino Uno | |
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash | |
DEBUG: Current (avr-stub) On-board (avr-stub, simavr) | |
PACKAGES: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Compiled on 9/17/2021 7:46:51 PM | |
#include <inttypes.h> | |
#include <stdbool.h> | |
#ifndef JUNIPER_H | |
#define JUNIPER_H | |
#include <stdlib.h> | |
namespace juniper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
class Choice(): | |
def __init__(self, move, value, depth): | |
self.move = move | |
self.value = value | |
self.depth = depth | |
def __str__(self): | |
return (str(self.move) + ": " + str(self.value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
class Choice(): | |
def __init__(self, move, value, depth): | |
self.move = move | |
self.value = value | |
self.depth = depth | |
def __str__(self): | |
return (str(self.move) + ": " + str(self.value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning#Pseudocode | |
# gist is saved as a .py file, but that's just for highlighting | |
# this isn't valid python code. | |
function alphabeta(node, depth, α, β, maximizingPlayer) is | |
if depth = 0 or node is a terminal node then | |
return the heuristic value of node | |
if maximizingPlayer then | |
value := −∞ | |
for each child of node do | |
value := max(value, alphabeta(child, depth − 1, α, β, FALSE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ttt.player import Player | |
from ttt.game import Game | |
from ttt.random_bot import RandomBot | |
from ttt.invincibot import InvinciBot | |
from datetime import datetime | |
def main(): | |
dateTimeObj = datetime.now() | |
print(dateTimeObj) | |
xbot = InvinciBot(Player.x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
class Choice(): | |
def __init__(self, move, value, depth): | |
self.move = move | |
self.value = value | |
self.depth = depth | |
def __str__(self): | |
return (str(self.move) + ": " + str(self.value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ttt.player import Player | |
from ttt.game import Game | |
from ttt.random_bot import RandomBot | |
from ttt.two_layer_bot import TwoLayerBot | |
def main(): | |
xbot = RandomBot(Player.x) | |
obot = TwoLayerBot(Player.o) | |
game = Game(1000) | |
print ("randombot (x) vs twolayerbot (o)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import copy | |
class TwoLayerBot(): | |
def __init__(self, player): | |
self.player = player | |
def select_move(self, board): | |
losing_move = None | |
first_candidates = board.get_legal_moves() |
NewerOlder