mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
remove script references to str from
This commit is contained in:
parent
0171910dfb
commit
8e8113921e
2 changed files with 3 additions and 4 deletions
|
@ -21,11 +21,10 @@ $"($row_header)($row_data)($nl)($nl)"
|
||||||
# This is the meat of the script that prints the little squares of color
|
# This is the meat of the script that prints the little squares of color
|
||||||
seq 0 6 | each { |row_idx|
|
seq 0 6 | each { |row_idx|
|
||||||
let r = ($"($row_idx) * 36 + 16" | math eval)
|
let r = ($"($row_idx) * 36 + 16" | math eval)
|
||||||
let row_header = (echo $r | str from -d 0 | str lpad -c ' ' -l 4)
|
let row_header = (echo $r | into string -d 0 | str lpad -c ' ' -l 4)
|
||||||
let row_data = (seq 0 35 | each { |row|
|
let row_data = (seq 0 35 | each { |row|
|
||||||
let val = ($"($r + $row)" | math eval | str from -d 0)
|
let val = ($"($r + $row)" | math eval | into string -d 0)
|
||||||
$"($ansi_bg)($val)m (ansi -e 'm') "
|
$"($ansi_bg)($val)m (ansi -e 'm') "
|
||||||
} | str collect)
|
} | str collect)
|
||||||
$"($row_header) ($row_data)($nl)($nl)"
|
$"($row_header) ($row_data)($nl)($nl)"
|
||||||
} | str collect
|
} | str collect
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ def print2 [
|
||||||
|
|
||||||
# A print command that concatenates arguments together with an optional separator.
|
# A print command that concatenates arguments together with an optional separator.
|
||||||
# This print command will also concatenate tables like [1 2 3] as well as most other primitives
|
# This print command will also concatenate tables like [1 2 3] as well as most other primitives
|
||||||
# since the str from command has been updated with wider support.
|
# since the into string command has been updated with wider support.
|
||||||
def print3 [
|
def print3 [
|
||||||
--separator(-s):any # Optional separator (not yet flagged as optional?)
|
--separator(-s):any # Optional separator (not yet flagged as optional?)
|
||||||
--flat(-f) # If tables are found, flatten them
|
--flat(-f) # If tables are found, flatten them
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue