Created
May 11, 2014 07:05
-
-
Save sideb0ard/86597ed7dbc4ae6197dc to your computer and use it in GitHub Desktop.
insertionSort.go
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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
) | |
func main() { | |
if len(os.Args) == 1 { | |
log.Fatal("GIMME STRINGSZZZZ") | |
} | |
for i := range os.Args { | |
jobbie(stringify(os.Args[(i + 1):])) | |
} | |
fmt.Println("DONE!") | |
} | |
func jobbie(bigstringy string) { | |
fmt.Println(bigstringy) | |
var Stringies = strings.Split(bigstringy, " ") | |
if len(Stringies) == 1 { | |
return | |
} | |
jobbie(stringify(Stringies[0 : len(Stringies)-1])) | |
} | |
func stringify(stingz []string) string { | |
var unifiedString bytes.Buffer | |
for i := range stingz { | |
if i != 0 { | |
unifiedString.WriteString(" ") | |
} | |
unifiedString.WriteString(stingz[i]) | |
} | |
return unifiedString.String() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment