Rosetta Code:Village Pump/Suggest a programming task: Difference between revisions

Radix-50
(→‎Unsorted: color wheel)
(Radix-50)
Line 780:
 
This should likely be sorted under 1.2.2.1, Graph algorithms.
 
=== Radix-50 encoding and decoding ===
 
[[wp:DEC_Radix-50|Radix-50]] is a method of encoding a restricted character set, used by DEC to store compiler labels and filenames. Each 16-bit word stores three characters encoded as char1*40*40 + char2*40 + char3. The name Radix-50 comes from 50(octal) = 40(decimal).
 
Challenge:
* encode up to three characters into a single word, indicate what you do with invalid characters
* decode a single word into three characters, indicate what you do with invalid data (word>=40*40*40)
* encode a string, indicate what you do with invalid characters
* decode to a string, indicate what you do with invalid data (word>=40*40*40)
 
 
The character set to be used is:
" ABCDEFGHIJKLMNOPQRSTUVWXYZ$?%0123456789"
 
==Insufficient information==
Anonymous user