Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1,13 +1,11 @@
Floyd ← ⊜□⇌/(⊂↯.:)⟜(+1⇡/+)+1⇡
Floyd ← ⊜□▽.⟜(+1⇡/+)+1⇡
Print ← (
≡(□≡(°⋕)) # Stringify terms.
≡(⊢⬚""↯⊟∞:°□)⟜(◇/↥⧻) # Pad rows with "" to same dims.
≡⊟¤+1≡◇⧻⊡¯1. # Find pads and couple with each.
≡(
≡(□/◇⊂↙¯⟜(⊂↯⊙@ )∩°□°⊟)⍉ # Prepad each term.
&p/⍚⊂ # Join each row and print.
)
⬚""≡°⋕ # Stringify terms
/↥≡◇⧻♭. # Get max length
≡≡◇⬚@ ↙¯ # Pad strings
≡(&p/$"_ _") # Print
)
Print Floyd 4
&p""
Print Floyd 14

View file

@ -0,0 +1,17 @@
fn main() {
floyd(5)
floyd(14)
}
fn floyd(rows int) {
println('Floyd ${rows}:')
mut num:=0
for row in 1..rows+2{
for _ in 1..row{
num++
fnum:=' '+num.str()
print(fnum[fnum.len-3..]+' ')
}
println('')
}
}

View file

@ -0,0 +1,13 @@
!yamlscript/v0
defn main(n):
nums =: range().map(inc).map(str)
rows =:
loop row-n 1, nums nums, rows []:
if rows.# < n:
recur: row-n.++ nums.drop(row-n)
conj(rows nums.take(row-n))
else: rows
width =: rows:last:last:len
fmt =: \((' ' * (width - len(_))) + _)
each row rows: say(row.map(fmt):joins)