// Forcodes.kt Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2020-10-27 File created. fun main() { var number_of_codes_on_this_line = 0 print( "\n The visible characters with codes from 20" + "\n to 7F (hexadecimal) are the following:\n\n " ) for ( numerical_code in 0x20 .. 0x7F ) { // The numerical code will be printed both as a character and // as a hexadecimal value. print( String.format( "%c %X ", numerical_code, numerical_code ) ) number_of_codes_on_this_line += 1 if ( number_of_codes_on_this_line == 8 ) { print( "\n " ) number_of_codes_on_this_line = 0 } } print( "\n" ) }