Created
July 11, 2016 04:30
-
-
Save garrettgsb/88986ca5cf8c8e5e496e0b049157caa4 to your computer and use it in GitHub Desktop.
NotFizzBuzz
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
contract NotFizzBuzz { | |
//By Garrett B | |
function selectionSort(uint[] x) returns (uint[]){ | |
uint length = x.length; | |
for (var i = 0; i < length-1; i++) { | |
for (var j = i; j < length; j++) { | |
if (x[i] > x[j]) { | |
uint a = x[i]; | |
uint b = x[j]; | |
x[i] = b; | |
x[j] = a; | |
} | |
} | |
} | |
return x; | |
} | |
function factorial(uint x) returns (uint) { | |
if (x - 1 > 0) { | |
x = x * factorial(x - 1); | |
} | |
return x; | |
} | |
function sqrt(uint x) returns (uint) { | |
for (uint i = 0; i*i <= x; i += 1) { | |
uint a=i; | |
} | |
return a; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment