Skip to content

Commit

Permalink
Better algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Taoufik El Aoumari committed Feb 8, 2024
1 parent 6e43d32 commit a9d989a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
18 changes: 0 additions & 18 deletions bin/booklet.py

This file was deleted.

13 changes: 6 additions & 7 deletions bin/booklet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ _mktemp() {
}

_range() {
local n=$N
p=0
while (( p < n/2 ))
i=0
((a=0)); ((b=N/4))
((z=N)); ((y=N-b))
while (( a < N/4 ))
do
echo -n "$((n-p)) $((p+1)) $((n-p-2)) $((p+3)) "
p=$(( p+2 ))
echo -n "$((p)) $((n-p+1)) $((p+2)) $((n-p-1)) "
p=$(( p+2 ))
echo -n "$((z--)) $((++a)) $((y--)) $((++b)) "
echo -n "$((++a)) $((z--)) $((++b)) $((y--)) "
done
echo
}
Expand Down

0 comments on commit a9d989a

Please sign in to comment.