The remaining thing is formatting output.$ghc pgm.hs $./pgm $cat test.pgm P5 # PGM type grayscale image 255 255 255 [167,222,176,132,221,175,81,7,160,123,62,170,122,60,83,148,210,160,61,88,86,192,124,51,56,167,247,234,191,210,146,149,95,37,150,26,174,238,24,165,3,41,226,115,191,62,201,146,230,19,245,148,183,72,45,33,229,240,172,236,89,182,230,65,228,53,56,54,66,75,247,234,224,27,110,31,22,40,133,220,211,243,133,97,179,129,51,183,216,106,188,23,217,99,56,239,143,1,2,31,5,85,234,133,3,106,85,137,75,205,183,141,174,55,58,56,24,163,70,133,78,124,12,84,98,23,230,181,36,232,235,65,182,71,244,53,207,251,77,166,41,62,48,168,112,70,64,206,208,242,213,1,61,177,220,152,41,82,247,16,21,85,209,88,82,23,140,28,179,243,7,254,201,183,194,115,251,130,110,69,35,179,9,58,201,91,145,107,191,72,51,217,135,112,47,173,55,41,246,176,61,86,255,3,237,25,185,161,177,20,33,113,174,14,123,189,82,106,157,149,111,60,236,199,30,75,90,148,146,0,173,99,24,200,108,103,62,93,137,172,158,127,11,56,219,144,185,25,75,75,119,36,47,104,152]
- Uncategorized
- 304 view
[Haskell] Make PGM File part2
Result is like this.