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 datetime import datetime | |
start_time = datetime.now() | |
starting_fish = [int(i) for i in open("AoC_2021_D6.txt", "r").read().split(',')] | |
total = 0 | |
# Counts how many fish have the same days left till spawn | |
current_states = { | |
0: starting_fish.count(0), | |
1: starting_fish.count(1), |
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
def isSolved(board): | |
print(board) | |
def check_rows(game_board): | |
for i in range(len(game_board)): | |
row = (game_board[i][0], game_board[i][1], game_board[i][2]) | |
if (len([i for i in row if i == 1]) == 3): |
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
"""However, they do remember a few key facts about the password: | |
It is a six-digit number. | |
The value is within the range given in your puzzle input. | |
Two adjacent digits are the same (like 22 in 122345). | |
Going from left to right, the digits never decrease; they only ever increase or stay the same (like 111123 or 135679). | |
Other than the range rule, the following are true: | |
111111 meets these criteria (double 11, never decreases). | |
223450 does not meet these criteria (decreasing pair of digits 50). |
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
"""However, they do remember a few key facts about the password: | |
It is a six-digit number. | |
The value is within the range given in your puzzle input. | |
Two adjacent digits are the same (like 22 in 122345). | |
Going from left to right, the digits never decrease; they only ever increase or stay the same (like 111123 or 135679). | |
Other than the range rule, the following are true: | |
111111 meets these criteria (double 11, never decreases). | |
223450 does not meet these criteria (decreasing pair of digits 50). |
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 os | |
import re | |
from time import sleep | |
class bc: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' |
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 os | |
import re | |
from time import sleep | |
class bc: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' |
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 os # Allows access to system statistics | |
import psutil # Allows access to virtual memor stats | |
from pyspectator.processor import Cpu # Python library for access resource stats (CPU) | |
from pyspectator.network import NetworkInterface # Library for access resource stats (NIC) | |
from pythonping import ping # Library used for the simplified running of network commands | |
import re # Regex for detecting patterns in strings | |
import subprocess # Library for running terminal commands through Python | |
from time import sleep # Pauses code exection. Time passed to method in 'seconds' | |
import tkinter as tk # Library used to create the GUI and its widgets | |
from tkinter import * |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
namespace StringMix | |
{ | |
class Program |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Threading; | |
namespace TexasHoldem | |
{ | |
public class Program | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
/// <summary> | |
/// https://www.codewars.com/kata/51ba717bb08c1cd60f00002f | |
/// </summary> |
NewerOlder