Search results
Results From The WOW.Com Content Network
s>number? \ attempt to convert to a number in base 10 if \ check if successful d>s \ drop a number (don't need double-precision) 64 + emit \ add to 64 and output the ascii letter at that value else \ if not successful (input was a letter) 2drop d>s \ get rid of garbage number conversion result and string-length
Example Our input is the number 12321. We loop through the digits: 1: this is less than 2, so we keep this and wait for the next digit. 2: combine with the previous digit, 1, to get 12. Index into the lowercase alphabet (0-indexed) to get m 3: this is more than 2, so we output the 3rd letter of the alphabet (0-indexed), d
29. Problem: You are making a new phone where people can type in specialized phone numbers, for example, 1-800-program, and they would be converted automatically to a usable phone number, like 1-800-7764726 (for the previous example). Your program will recieve a string if any length with numbers, letters and dashes, and convert all the letters ...
37 bytes, as an expression. Uses the same base-36 method as many others, but further, obtaining all the letters from a single number. Requires BigInt support.
Given a number, program must return the alphabet letter correspondent. The challenge here is to make it as short as possible, everyone knows it is a very easy program to do.
Z. Generate the uppercase alphabet prefixed by @. This works by feeding in Z s and transliterating a step backwards each time until the transformation becomes idempotent. . $.`. $&¶. Prefix each character with its 0-based index and . , and split each character on to its own line. A`@. Delete the @ entry. Share.
Inspired by the connection rules from Calvin's Hobbies' question Make me an alphabet tree take a number of lines of letters as input and output the number of distinct connected trees it represents.
We start by constructing a list with 3 elements: the lowercase alphabet, the uppercase alphabet, and the input. ( [GrG1z) Then, we filter this list on the number of appearances of the input in the elements being nonzero.
The aaaaa way is simply replacing each digit of the input number with the letter at that position in the alphabet. For example, 11111 would become aaaaa and 21223 would become babbc. If the number is less than 5 digits you need to left-pad it with an "A". For example, 12 would be AAAab.
To encode with the alphabet cipher (I will be using the example hello): First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) Example: 8 5 12 12 15. Pad each number to two characters with 0 s. Example: 08 05 12 12 15.