#!/usr/bin/env swift; /****************************************************************************** * This program reads bytes from STDIN and prints them in decimal format. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ import Foundation import Utils // Begin Main var c:UInt8? var count:Int = 0 c = Utils.getbyte(FileHandle.standardInput) while c != nil { print(String(c!) + " ", terminator: "") count += 1 if count % 20 == 0 { print() } c = Utils.getbyte(FileHandle.standardInput) } if count % 20 != 0 { print() } exit(EXIT_SUCCESS)