Bitmap/Write a PPM file: Difference between revisions

m
→‎{{header|BQN}}: Trivial simplifications: +¨ to +, and combine 256| of a list
mNo edit summary
m (→‎{{header|BQN}}: Trivial simplifications: +¨ to +, and combine 256| of a list)
Line 367:
all ← ∾red‿grn‿ble‿blk‿gry‿wht # join "colors" to 1D list
image_ppm ← 8‿4‿3 ⥊ all # reshape "all" to 8 rows by 4 cols by 3, "all" gets reused as needed to fill
image_ppm ↩ @ +¨ ⥊ image_ppm # deshape, convert to chars (uint8_t)
bytes_ppm ← header_ppm ∾ image_ppm
"small.ppm" •file.Bytes bytes_ppm</lang>
Line 375:
255
"
image_ppm ← @ +¨ ⥊ > {(256|𝕨)‿𝕨‿𝕩‿(256|𝕩)‿(256|𝕨×𝕩)}⌜˜ ↕800
"first_bqn.ppm" •file.Bytes header_ppm ∾ image_ppm</lang>
 
99

edits