15
1
The challenge is simple: Determine the type of an input, and output an identifier telling what type it is.
- "UI", Unsigned integer:
0
,1
,34
,111111111111111111111111111111111111111111
- "SI", Signed integer:
+0
,+1
,+42
,-1
,-3
,-111111111111111111111111111111111111111111
- "UD", Unsigned decimal:
0.0
,1.23
,1234.1234
- "SD", Signed decimal:
-0.0
,+0.0
,-1.235
- "LE", Letter:
a
-z
andA
-Z
- "SY", Symbol: ASCII code points:
[32-47, 58-64, 91-96, 123-126]
(i.e. all characters except numbers and letters) - "ST", String: Two or more character that can't be parsed as any of the above number formats
Rules:
- The input will be 1-99 characters long
- The input will only contain printable ASCII characters, code points: 32-126.
- The output should be the two identifier letters as defined above (UI, SI ...)
- Standard I/O rules apply
Examples:
UI:
0
01
34
12938219383278319086135768712319838871631827319218923
SI:
-0
+01
+1
-123
+123
UD:
0.0
3.1415
2.718281828459045235360287471352662497757
SD:
+0.0
-3.1415
+2.718281828459045235360287471352662497757
LE:
a
k
L
Z
SY:
@
"
+
-
ST:
Hello, World!
f2!"
+23df
1234A
'"!
.012
1.
UI
+-1
5+3
Can
SY
be more than one character? – FryAmTheEggman – 2016-03-31T15:27:42.757I would not consider
111111111111111111111111111111111111111111
to be of integer type. – Matt – 2016-03-31T16:31:11.110@FryAmTheEggman sy is only one character. – Stewie Griffin – 2016-03-31T17:01:45.293
So we take the input as a string? – lirtosiast – 2016-03-31T17:03:21.140
6
@Matt, It might not be a
– Stewie Griffin – 2016-03-31T21:35:15.733uint8
orint64
, but it's definitely an integer.Here +45 is not signed it is PI positive integer (as 45) ... Your classification can not be so easy to write in Axiom. "signed integer" here and in C language too are called "int" or "INT" – RosLuP – 2017-11-14T16:56:30.837
@RosLuP it's not meant to be the type your language interprets it as. You should simply output two characters based on the input string/number. – Stewie Griffin – 2017-11-28T20:43:56.927
+38 is not signed it is unsigned. – RosLuP – 2017-11-29T11:24:45.467
@RosLuP I'm not sure you get the point of this challenge. It doesn't matter how it's interpreted in some language, or what the normal naming convention for numbers is. In this challenge "signed" is defined as: "There's a plus or minus sign followed by a number". You may disregard the words signed and unsigned doesn't actually affect the challenge, you should output a two character string based on some input. – Stewie Griffin – 2017-11-29T13:22:08.967