Compare commits
No commits in common. "c12d2d91a11426569db0b34b7da589e685bb86f5" and "1ac4bf24bc7ac62c09e8ee88f5b55d1802283745" have entirely different histories.
c12d2d91a1
...
1ac4bf24bc
|
@ -1,24 +0,0 @@
|
||||||
# ---> Go
|
|
||||||
# If you prefer the allow list template instead of the deny list, see community template:
|
|
||||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
|
||||||
#
|
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
*.txt
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
|
||||||
# vendor/
|
|
||||||
|
|
||||||
# Go workspace file
|
|
||||||
go.work
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
FILE="./array-sorter"
|
|
||||||
|
|
||||||
echo {1..300} > ./numbers.txt
|
echo {1..300} > ./numbers.txt
|
||||||
cat ./numbers.txt | tr ' ' "\\n" | shuf | tr "\\n" ' ' > ./random.txt
|
cat ./numbers.txt | tr ' ' "\\n" | shuf | tr "\\n" ' ' > ./random.txt
|
||||||
if test -f ./array-sorter; then
|
go run . $(cat ./random.txt)
|
||||||
echo "$FILE exists, running"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "$FILE doesn't exist, building"
|
|
||||||
go build -o $FILE .
|
|
||||||
fi
|
|
||||||
./array-sorter $(cat ./random.txt)
|
|
||||||
|
|
|
@ -43,9 +43,7 @@ func sorter(arr []float64) (orderedArr []float64) {
|
||||||
//var numValue float64
|
//var numValue float64
|
||||||
sliced_arr := arr
|
sliced_arr := arr
|
||||||
|
|
||||||
// IT WAS THIS BASTARD WHO KEPT CAUSING OUT OF BOUNDS ERRORS
|
// TODO: get the actual sorting working
|
||||||
// I KEPT READING THE LENGTH OF THE ORIGINAL ARRAY INSTEAD OF THE
|
|
||||||
// ARRAY BEING SLOWLY EMPTIED
|
|
||||||
for i := 0; i < len(sliced_arr); {
|
for i := 0; i < len(sliced_arr); {
|
||||||
// fmt.Printf("Current slice length: %v\n", sliced_arr)
|
// fmt.Printf("Current slice length: %v\n", sliced_arr)
|
||||||
// fmt.Println(orderedArr)
|
// fmt.Println(orderedArr)
|
||||||
|
|
Loading…
Reference in New Issue