Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
void printBoard(char board[3][3])
{
import random
from time import sleep
import math
import pynput
from threading import *
from pynput.keyboard import Listener
from termcolor import colored
from os import system
# all of the variables here are needed to break out of while loops using pynput
import random
import curses
from curses import wrapper
from time import sleep
import math
#this class will establish and draw a board
class Board:
from termcolor import colored, cprint
#this class will create a board array as well as draw input to the board
class Board:
#creates a 2d array relative to rows and columns
def __init__(self, rows, columns):
import time
import random
board = [[' ', ' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ', ' '],
[' ', ' ', ' ', ' ', ' ', ' ']]
import random
import time
#print board
board = [["-", "-", "-"],
["-", "-", "-"],
["-", "-", "-"]]
def print_board():
import random
import time
row1 = [" ", " ", " "]
row2 = [" ", " ", " "]
row3 = [" ", " ", " "]
#draws the board to the screen
def display(row1, row2, row3):