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
# Test me | |
Connect |
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 PIL, random, sys | |
from PIL import Image, ImageDraw | |
origDimension = 1500 | |
r = lambda: random.randint(50,215) | |
rc = lambda: (r(), r(), r()) | |
listSym = [] | |
def create_square(border, draw, randColor, element, size): | |
if (element == int(size/2)): | |
draw.rectangle(border, randColor) | |
elif (len(listSym) == element+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
function setup() { | |
var canvasDiv = document.getElementById('sketchdiv') | |
var width = canvasDiv.offsetWidth | |
var height = 600 | |
var cnv = createCanvas(width, height); | |
cnv.parent('sketchdiv'); | |
background(206, 200, 176); | |
} |
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
.row_2::after { | |
content: ""; | |
clear: both; | |
display: table; | |
} | |
.column_6 { | |
float: left; | |
width: 100%; | |
padding: 5px; |
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
<div class="row_2"> | |
<div class="column_6"> | |
<div id="sketchdiv" style="min-height: 1px;"> | |
</div> | |
</div> | |
</div> |
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 substring(*arg): | |
# Unknown number of arguments | |
arg_length = len(arg) | |
# Input string and output | |
orig = '' | |
out = '' | |
# Return original string if no other parameters are given | |
if (arg_length > 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
import random | |
# First element is the attack, the following elements are weaknesses | |
attacks = [ | |
['rock', 'paper'], | |
['paper', 'scissors'], | |
['scissors', 'rock'] | |
] | |
# Tracking game progress |
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
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] | |
def day_offset(day, offset): | |
return days[(days.index(day) + offset) % 7] | |
if __name__ == "__main__": | |
print(day_offset("Wednesday", 5)) # Monday | |
print(day_offset("Monday", 0)) # Monday | |
print(day_offset("Saturday", -1)) # Friday |
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
extends Node2D | |
var messages = [ | |
"My First Message", | |
"Second Message For You" | |
] | |
var typing_speed = .1 | |
var read_time = 2 |
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
// Created from: https://github.com/hughsk/glsl-dither | |
// Inspired by: https://www.youtube.com/watch?v=npno7zivwrQ | |
shader_type canvas_item; | |
float dither8x8(vec2 position, float brightness) { | |
int x = int(mod(position.x, 8.0)); | |
int y = int(mod(position.y, 8.0)); | |
int index = x + y * 8; |
OlderNewer