Skip to content

Instantly share code, notes, and snippets.

View cparnot's full-sized avatar

Charles Parnot cparnot

View GitHub Profile
@cparnot
cparnot / Collatz+.playground
Last active October 26, 2016 20:06
Collatz function
// Returns the number of iterations to get from n to 1
// when following the sequence that forms the basis of the
// Collatz conjecture (https://en.wikipedia.org/wiki/Collatz_conjecture)
func collatz(_ n : Int) -> Int {
if n == 1 {
// end at 1
return 0
}
else if n % 2 == 0 {
// even
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>For Sale</title>
<link rel="stylesheet" type="text/css" href="for_sale.css" />
</head>
<body>
<div class='item'>
<img src='https://photos-1.dropbox.com/si/shg_178/m9yzvifJIwqvXx2eF95UrJWzMZx87t-Vu3TvPwsLdJA/360874/1344034800/6555318/Bunk%20bed%202.JPG?prep_size=1280x960%2C32bf'/>