Here we go. Here's a nice gist.
Check me out:
3.times do
puts "Hello, there"
end
#!/usr/bin/env python3 | |
import argparse | |
import fileinput | |
parser = argparse.ArgumentParser(description="Convert tabs in markdown files to spaces.") | |
parser.add_argument("-a", "--all", action="store_true", help="Convert all tabs to spaces") | |
parser.add_argument("-n", "--number", type=int, default=4, help="Number of spaces to use.") | |
parser.add_argument('files', metavar='FILE', nargs='*', help="files to read, if empty, stdin is used") |
import turtle | |
window = turtle.Screen() | |
window.setup(width=800, height=600, startx=10, starty=0.5) | |
euler = turtle.Turtle() # A good mathy name for our turtle | |
euler.shape("turtle") | |
scale = 5 # This isn't a turtle module setting. This is just for us. | |
# Move the little buddy over to the left side to give him more room to work | |
euler.penup() |
import turtle | |
window = turtle.Screen() | |
euler = turtle.Turtle() # A good mathy name for our turtle | |
euler.shape("turtle") | |
current = 0 # Here's how we know where we are | |
seen = set() # Here's where we'll keep track of where we've been | |
# Step increases by 1 each time |
import turtle | |
window = turtle.Screen() | |
euler = turtle.Turtle() # A good mathy name for our turtle | |
euler.shape("turtle") | |
current = 0 # Here's how we know where we are | |
seen = set() # Here's where we'll keep track of where we've been | |
# Step increases by 1 each time |
import turtle | |
window = turtle.Screen() | |
joe = turtle.Turtle() | |
joe.forward(50) | |
joe.left(90) | |
joe.forward(100) | |
turtle.done() |
Here we go. Here's a nice gist.
Check me out:
3.times do
puts "Hello, there"
end
#!/usr/bin/env zsh | |
lightgrey() { | |
print -nrP -- "%{$FG[250]%}$@" | |
} | |
grey() { | |
print -nrP -- "%{$FG[244]%}$@" | |
} | |
white() { | |
print -nrP -- "%{$FG[255]%}$@" |
"""Calculate how much water is trapped between walls. | |
| | | |
Basically, wall sections of the pattern |___| are easier to calculate than |___|. So, | |
Split the walls up into water-tight sections where the last wall >= the first wall. | |
If that's not possible, then reverse the whole section so that you have at least one increasing section | |
and keep working. | |
| | | | | | | |
|__|__|__|__| This gets processed in these chunks: |__|, |__|, |__|, and |__|. | |
They hold 1, 2, 1, and 1, respectively, for a total of 5! |
function walle | |
set light_blue C7E2E8 | |
set gray C1C1BD | |
set light_gray EEE | |
set dark_gray 565653 | |
set bronze C6973F | |
set yellow FFE500 | |
set lime C6E80B | |
set brown 8C5D05 |