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
# For my untitled roguelike, I want to procedurally generate the | |
# map of the surface. After reading/skimming many articles and blog | |
# posts, I hit on the diamond-square algorithm. Some of the examples | |
# I'd seen produced nice enough maps, and I was able to understand | |
# how it worked better than, say, Perlin Noise. My roguelike is going | |
# to be done in Rust, but I find Python way easier to prototype in. | |
# So, here's my attempt to implement the diamond-square algorithm | |
# (https://en.wikipedia.org/wiki/Diamond-square_algorithm) | |
import math |
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
# For my untitled roguelike, I want to procedurally generate the | |
# map of the surface. After reading/skimming many articles and blog | |
# posts, I hit on the diamond-square algorithm. Some of the examples | |
# I'd seen produced nice enough maps, and I was able to understand | |
# how it worked better than, say, Perlin Noise. My roguelike is going | |
# to be done in Rust, but I find Python way easier to prototype in. | |
# So, here's my attempt to implement the diamond-square algorithm | |
# (https://en.wikipedia.org/wiki/Diamond-square_algorithm) | |
from enum import Enum |
This file has been truncated, but you can view the full file.
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
Q1: 26868 | |
Immunes: 155 | |
Stalemate at boost:, 84 | |
Immunes: 413 | |
Stalemate at boost:, 88 | |
Immunes: 140 | |
Stalemate at boost:, 89 | |
Round: 1 | |
Infection 3 attacks Immume 0 for 145404, 26 of 2987 killed. | |
Immume 1 attacks Infection 7 for 271260, 7 of 5519 killed. |
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
(* Euler problem 1 | |
I know you can just straight calculate the sum but | |
that wouldn't teach me much about F# :P | |
*) | |
open System | |
[<EntryPoint>] | |
let main argv = | |
let sum = | |
[1..999] |
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
(define atom? | |
(lambda (x) | |
(and (not (pair? x)) (not (null? x))) | |
)) | |
(define lat? (lambda (l) | |
(cond ( | |
(null? l) #t) | |
((atom? (car l)) (lat? (cdr l))) | |
(else #f) |
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 re | |
import json | |
import os | |
import mechanize | |
def get_activity_id(activity): | |
return activity['activity']['activityId'] | |
def get_activity_type(activity): | |
return activity['activity']['activityType']['key'] |