Do I need to say more?
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 <stdlib.h> | |
#include <stdio.h> | |
char* strindex(char* src,int start, int end) { | |
int len = end - start; | |
char* dst = malloc(len + 2); | |
for (int i = 0; i < (end - start) + 1; i++) | |
dst[i] = src[i + start]; | |
dst[len + 1] = 0; | |
return dst; |
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 <stdio.h> | |
#include <string.h> | |
int win(int board[9]) { | |
int wins[8][3] = {{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}}; | |
for(int i = 0; i < 8; ++i) { | |
if(board[wins[i][0]] != 0 && | |
board[wins[i][0]] == board[wins[i][1]] && | |
board[wins[i][0]] == board[wins[i][2]]) | |
return board[wins[i][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
mod line_noise { | |
pub use core::time::Duration; | |
pub extern crate nalgebra as na; | |
pub use na::{Vector3,Vector2}; | |
pub use nalgebra::max; | |
pub use nalgebra::Rotation3; | |
pub use nalgebra::Isometry3; | |
pub use nalgebra::Point; | |
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
#![feature(trait_alias)] | |
mod line_noise { | |
pub use core::time::Duration; | |
pub extern crate nalgebra as na; | |
pub use na::{Vector3,Vector2}; | |
pub use nalgebra::max; | |
pub use nalgebra::Rotation3; | |
pub use nalgebra::Isometry3; |
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
|title Barrel - Part 1| |subtitle Don't we all.| |trascript [[A boy sits in a barrel which is floating in an ocean.]]/Boy: I wonder where I'll float next?/[[The barrel drifts into the distance. Nothing else can be seen.]]/{{Alt: Don't we all.}}| |url https://xkcd.com/1/| | |
|title Petit Trees (sketch)| |subtitle 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch| |trascript [[Two trees are growing on opposite sides of a sphere.]]/{{Alt-title: 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch}}| |url https://xkcd.com/2/| | |
|title Island (sketch)| |subtitle Hello, island| |trascript [[A sketch of an Island]]/{{Alt:Hello, island}}| |url https://xkcd.com/3/| | |
|title Landscape (sketch)| |subtitle There's a river flowing through the ocean| |trascript [[A sketch of a landscape with sun on the horizon]]/{{Alt: There's a river flowing through the ocean}}| |url https://xkcd.com/4/| | |
|title Blown apart| |subtitle Blown into prime |
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
struct Gen { | |
key: i32 | |
} | |
impl Iterator for Gen { | |
type Item = u8; | |
fn next(&mut self) -> Option<Self::Item> { | |
self.key += 1; | |
Some(( | |
((self.key+3*3)^17)%256 | |
) as u8) |
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
#!/bin/bash | |
#sleep sort | |
function f() { | |
sleep "$1" | |
echo "$1" | |
} | |
while [ -n "$1" ] | |
do | |
f "$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 math | |
prefixes = [ | |
("yotta",24), | |
("zetta",21), | |
("exa",18), | |
("peta",15), | |
("tera",12), | |
("giga",9), | |
("mega",6), |
OlderNewer