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
Show hidden characters
{ | |
// Python. | |
"jupyter.askForKernelRestart": false, | |
"python.formatting.provider": "black", | |
"[python]": { | |
"editor.rulers": [88] | |
}, | |
// C/C++. | |
"C_Cpp.clang_format_fallbackStyle": "LLVM", |
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
# Maciej Goszczycki 2019 | |
# Human is always True. We invert the board when drawing to show the right symbol. | |
from functools import lru_cache | |
import random | |
import re | |
def colour(colour, text): | |
return f"\033[{30 + colour}m{text}\033[0m" |
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 functools import lru_cache | |
def straight(board, i): | |
return ( | |
board[i][0] == board[i][1] == board[i][2] is not None | |
or board[0][i] == board[1][i] == board[2][i] is not None | |
) | |
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 collections import defaultdict, Counter | |
import pprint | |
def encode(x, known): | |
seen_vowels = {} | |
seen_other = {} | |
def check(seen, x, m): | |
if x in known: |
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
#include <cstdio> | |
#include <vector> | |
#define inline __attribute__((always_inline)) | |
namespace { | |
template <typename Iterator, typename Value, typename Checker> | |
class EasyIterator { | |
public: |
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
function! SetIndention(width) abort | |
let &l:tabstop=a:width | |
let &l:shiftwidth=a:width | |
let &l:softtabstop=a:width | |
endfunction | |
filetype plugin indent on | |
set nowrap | |
set hidden | |
set showcmd |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Student Assigments</title> | |
<style> | |
* { | |
padding: 0; | |
margin: 0; | |
box-sizing: border-box; | |
} |
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
/* ____ _ ____ | |
* / __ )_________ _(_)___ _________ _/ / / | |
* / __ / ___/ __ `/ / __ \/ ___/ __ `/ / / | |
* / /_/ / / / /_/ / / / / / /__/ /_/ / / / | |
* /_____/_/ \__,_/_/_/ /_/\___/\__,_/_/_/ | |
* | |
* Copyright 2017 Maciej Goszczycki | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |
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
extern crate futures; | |
extern crate tokio_core; | |
extern crate byteorder; | |
extern crate itertools; | |
use std::io::prelude::*; | |
use std::net::{SocketAddr, IpAddr}; | |
use std::io::{self, Cursor, Error, ErrorKind}; | |
use byteorder::{ReadBytesExt, WriteBytesExt}; |
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
use std::io::{self, BufReader}; | |
use std::fs::File; | |
use std::cmp::Ord; | |
use std::io::prelude::*; | |
fn main() { | |
// Read the input | |
let mut word = String::new(); | |
print!("Enter your letters: "); | |
io::stdout().flush().unwrap(); |
NewerOlder