5
1
Read input of up to 8 characters presented as hexadecimal number and print this number as decimal number. In case that input can not be presented as hexadecimal input it has to print 0
Rules:
It is not allowed to use any function that takes or returns strings/characters, beside function that reads string/char from input and return strings/char as-is, function that takes integer and prints that integer to output as decimal number and function (if needed) that takes character and return its ASCII/UNICODE represented integer.
Shortest code wins
Example input
C0cAc01a
output
3234512922
So im not quite sure here.. The function tonumber in lua is not allowed or is it? I can do it in 38 characters if thats allowed. – Teun Pronk – 2015-02-11T13:27:34.073
1@ralu you should narrow that down. Operators are functions. Methods are functions. If only in/out is accepted, how are we supposed to compute anything? – Álvaro Cuesta – 2012-08-16T06:29:28.100
4I'm not sure whether I understood the rules right; is it: (No fun a except (b, c, d)) or is it (No fun (a, except b), c, d)? – user unknown – 2011-09-30T04:56:41.823
You are not allowed any functions that returns or accepts chars/strings except mentioned one. Is that clear? – ralu – 2011-10-01T21:42:28.933