Compare commits

..

No commits in common. "c12d2d91a11426569db0b34b7da589e685bb86f5" and "1ac4bf24bc7ac62c09e8ee88f5b55d1802283745" have entirely different histories.

3 changed files with 2 additions and 36 deletions

View File

@ -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

View File

@ -1,13 +1,5 @@
#!/bin/bash
FILE="./array-sorter"
echo {1..300} > ./numbers.txt
cat ./numbers.txt | tr ' ' "\\n" | shuf | tr "\\n" ' ' > ./random.txt
if test -f ./array-sorter; then
echo "$FILE exists, running"
else
echo "$FILE doesn't exist, building"
go build -o $FILE .
fi
./array-sorter $(cat ./random.txt)
go run . $(cat ./random.txt)

View File

@ -43,9 +43,7 @@ func sorter(arr []float64) (orderedArr []float64) {
//var numValue float64
sliced_arr := arr
// IT WAS THIS BASTARD WHO KEPT CAUSING OUT OF BOUNDS ERRORS
// I KEPT READING THE LENGTH OF THE ORIGINAL ARRAY INSTEAD OF THE
// ARRAY BEING SLOWLY EMPTIED
// TODO: get the actual sorting working
for i := 0; i < len(sliced_arr); {
// fmt.Printf("Current slice length: %v\n", sliced_arr)
// fmt.Println(orderedArr)