Output your numeric user ID. Do not use 0-9 in your code. Code golf.
-
2\$\begingroup\$ Now that I've thought about this for a bit (and after figuring out the trivial answer for my language) this would've been better refined in the sandbox first since it can be considered by some to be not very interesting as it's basically been done before. Do X Without Y is one of the things question-makers need to be wary of leaning too heavily on because of trivializations like these. \$\endgroup\$Value Ink– Value Ink2025-05-22 05:48:58 +00:00Commented May 22, 2025 at 5:48
-
13\$\begingroup\$ Sure. My experience has been that there are lots more people willing to comment about how something should have gone through the sandbox than people willing to actually provide feedback in the sandbox. shrug IMHO it's fine to have bad questions: if they're not interesting to you, just find a different one. \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 06:02:54 +00:00Commented May 22, 2025 at 6:02
-
2\$\begingroup\$ I won't change the rules on this one now, but I'd encourage people to also submit an alternative version that doesn't rely on simply decoding a unicode character, as some of us have done already. \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 07:09:39 +00:00Commented May 22, 2025 at 7:09
-
2\$\begingroup\$ @SteveBennett It may be that some people don't know what there user ID is or where to find it. Apart from the URL, I don't know if it's actually available in a stackexchange user profile anywhere. Or if it's the same for all communities. My network user id is different from my codegolf one, for example. \$\endgroup\$stanri– stanri2025-05-23 05:49:20 +00:00Commented May 23, 2025 at 5:49
-
3\$\begingroup\$ This question is similar to: Produce the number 2014 without any numbers in your source code. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. \$\endgroup\$The Fifth Marshal– The Fifth Marshal2025-05-24 01:55:35 +00:00Commented May 24, 2025 at 1:55
54 Answers
-
1\$\begingroup\$ Heh, that's very cool :) \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 09:18:02 +00:00Commented May 22, 2025 at 9:18
brainfuck, 27 bytes
-[----->+<]>--.++++..++++..
Output 15599. I am fortunate that my user ID is made of increasing digits. The initial loop sets a cell to ASCII 51 = 255/5 which is the character 3 So it would be even better if my user ID started with 3, but you can't have everything.
MATLAB / Octave, 16 14 bytes
'Z'*['⦺']'
I was inspired by another answer which used matlab's very weak typing to subtract space from a string to get each digit of their id. I figured I could do something even worse: linear algebra with unicode characters!
matlab thinks of strings as an array of utf-8 bytes, and lets you abuse this without any consequences. read literally, we're taking the matrix product of 'Z' with the transpose of '⦺' (basically a fancy way of doing a dot product).
utf-8 needs to represent all of unicode while still being backwards compatible with ascii. if you look at the binary, all ascii looks like 0xxxxxxx, where xxxxxxx is the unicode index of that character in binary, so it keeps all of that the same.
to reach the rest of unicode, utf-8 uses a cute length-thing: 110xxxxx means 'this character uses 2 bytes', and 1110xxxx means 'this character uses 3 bytes' and so on. all the 'extention' bytes that come after the first byte are marked with 10xxxxxx to show that they are part of the previous character. (so unicode chars with an index under 11 bits look like 110xxxxx 10xxxxxx, unicode chars with an index under 16 bits look like 1110xxxx 10xxxxxx 10xxxxxx, and unicode
chars with an index under 21 bits look like 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx)
first, some analysis: with 3 bytes, the ascii range only gets up to 47628, with 4 bytes reaching 63504. neither of these are close to my id (119818). we actually would need at least 8 bytes on both sides if we were limited to ascii chars
however, non-ascii utf-8 bytes must necessarily have the top bit set, meaning they are much bigger. instead of each number sitting between 32 and 126, continuation bytes are between 128 and 191, the initial byte of 2-byte chars is between 192 and 223, and the initial byte of 3-byte chars is between 224 and 239. this gives us a range of roughly 53k to 86k for 2-byte chars (which includes 119818/2=59909), and 83k to 130k for 3-byte chars (which includes 119818).
I'm more familiar with julia than matlab, so I searched for 3-byte possibilities over there:
julia> collect(reinterpret(reshape, Int64, findall(iszero,
[[224+a 128+b 128+c]*[224+d;128+e;128+f])[1]-119818 for a=1:15,b=1:63,c=1:63,d=1:15,e=1:63,f=1:63])))
6×15056 Matrix{Int64}:
14 13 15 14 13 14 13 15 14 13 15 … 13 13 13 13 13 13 13 13 13 13
63 63 63 63 63 62 62 59 63 63 63 22 21 20 19 18 17 16 15 14 13
63 63 62 63 63 63 63 62 63 63 58 54 55 56 57 58 59 60 61 62 63
13 14 15 13 14 13 14 15 13 14 15 14 14 14 14 14 14 14 14 14 14
63 63 59 62 62 63 63 63 61 61 61 63 63 63 63 63 63 63 63 63 63
13 13 14 14 14 14 14 14 15 15 15 … 63 63 63 63 63 63 63 63 63 63
julia> filter(x->all(isprint.([x...])),
[Char(ans[1,i]<<12+ans[2,i]<<6+ans[3,i])*Char(ans[4,i]<<12+ans[5,i]<<6+ans[6,i]) for i=1:15056])
8436-element Vector{String}:
"ᢾ콾"
...
after filtering down to only pairs of printable characters, we still have 8436 options. 446 pairs have at least one lowercase char, 272 have uppercase, 272 have a punctuation, and there's no digits. 24 pairs have no letters, 1100 have one letter. unicode range is 0x18be to 0xfffd, with more towards the end of the range; so it's mostly cjk and hangul. ended up picking
[224+15 128+60 128+58]*[224+2;128+38;128+58] = 119818
or
[FULLWIDTH LATIN CAPITAL LETTER Z]*[CIRCLE DIVIDED BY HORIZONTAL BAR AND TOP HALF DIVIDED BY VERTICAL BAR]'
Old answer:
'Ňل'*['ʕł']'
since my userid is even, I originally aimed for userid/2, looking for 2-byte unicode characters that work. since id/2 is closer to the boundary here, there are only 13 pretty pairs of characters which multiply to half of my userid, so you can see them all: (first four fit in ascii so are invalid, next four have unprintables, then there's some hebrew punctuation character that doesn't show up on stackexchange)
18×2 Matrix{Vector}:
[69, 1545] ['E', '؉']
[73, 1541] ['I', '\u605']
[80, 344] ['P', 'Ř']
[88, 336] ['X', 'Ő']
[131, 1733] ['\u83', 'ۅ']
[133, 1731] ['\u85', 'ۃ']
[137, 851] ['\u89', '͓']
[147, 841] ['\u93', '͉']
[322, 1604] ['ł', 'ل']
[323, 1478] ['Ń', '׆']
[324, 1602] ['ń', 'ق']
[326, 1475] ['ņ', '׃']
[327, 661] ['Ň', 'ʕ']
[341, 647] ['ŕ', 'ʇ']
[449, 1102] ['ǁ', 'ю']
[462, 1089] ['ǎ', 'с']
[707, 1031] ['˃', 'Ї']
[711, 1027] ['ˇ', 'Ѓ']
since a dot product is a linear operation, you can stick two pairs next to each other and they add together, so this solution is
[192+5 128+7]*[192+10;128+21] + [192+25 128+4]*[192+5;128+2]=59909+59909=119818
Wolfram Language (Mathematica), 86 66 bytes
Saved 20 bytes thanks to an idea of DLosc!
Last@First@EntityValue[Interpreter["City"]["Tyler MN"],"ZIPCodes"]
Not super short, but fun: look up a city's ZIP code 😄
Previous code:
Last@First@EntityValue[Entity["City",{"Tyler","Minnesota","UnitedStates"}],"ZIPCodes"]
-
\$\begingroup\$ That's hilarious. \$\endgroup\$Steve Bennett– Steve Bennett2025-07-03 00:06:07 +00:00Commented Jul 3, 2025 at 0:06
-
\$\begingroup\$ Any chance you could use
MNinstead ofMinnesotaand/orUSforUnitedStates? \$\endgroup\$DLosc– DLosc2025-08-05 05:17:25 +00:00Commented Aug 5, 2025 at 5:17 -
\$\begingroup\$ Not directly, but I poked around and found a way to use your main idea—thank you! \$\endgroup\$Greg Martin– Greg Martin2025-08-05 16:07:13 +00:00Commented Aug 5, 2025 at 16:07
JavaScript (ES6), 18 bytes
Suggested by @l4m2
Computes +0xe4c3 = 58563.
_=>+atob`MHhlNGMz`
JavaScript (ES6), 22 bytes
This computes \$58563=242^2-1\$, where \$242\$ can be converted to MjQy in base-64.
_=>(q=atob`MjQy`)*q+~_
This is 1 byte longer than ...
JavaScript (ES6), 21 bytes
... the boring answer.
_=>"".charCodeAt()
-
2\$\begingroup\$ 18 bytes
atob\$\endgroup\$l4m2– l4m22025-05-22 07:46:50 +00:00Commented May 22, 2025 at 7:46 -
3\$\begingroup\$ Congrats on 200k! (a bit late...) \$\endgroup\$Luis Mendo– Luis Mendo2025-05-22 14:56:40 +00:00Commented May 22, 2025 at 14:56
-
1\$\begingroup\$ @LuisMendo Thank you! ;) \$\endgroup\$Arnauld– Arnauld2025-05-22 15:42:26 +00:00Commented May 22, 2025 at 15:42
Python, 10 bytes
b"t".hex
Creates and returns 101374 as a hex dump. Contains two unprintables.
Python, 23 bytes
-7 @xnor by printing directly avoiding string interpolation
print(*b'\n\rJ',sep='')
Python, 30 bytes
print('%d%d%d'%((*b'\n\rJ',)))
Writes 101374 by concatenating ASCII codes of \n,\r,J.
Or:
Python, 18 bytes (@xnor)
print(ord("𘯾"))
-
1\$\begingroup\$ Looks like you can just do
print(*b'\n\rJ',sep=''). Back luck for your user id to hit two escaped characters! Though there's also the boring solution ofprint(ord("𘯾"))\$\endgroup\$xnor– xnor2025-05-22 08:24:42 +00:00Commented May 22, 2025 at 8:24 -
\$\begingroup\$ @xnor Can split into
101 37 4where one unprintable exist. Can it somehow get resolved? \$\endgroup\$l4m2– l4m22025-05-22 11:38:43 +00:00Commented May 22, 2025 at 11:38
Ruby, 10 bytes
쯡 has character value 52194.
p'쯡'.ord
Ruby 1.8, 21 bytes
print'fq'.to_i(?!),?^
My original answer, here just for posterity's sake cuz it was more creative.
fq is 521 in base 33. Since ! has a byte value of 33, we can access it with ?!. Same with ?^ for 94, combining into 52194. No longer works in Ruby 1.9+ because in that version ?x symbols give one-character strings instead of the character's byte value.
-
\$\begingroup\$ ah damn, that same strategy would work in JavaScript. \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 05:29:56 +00:00Commented May 22, 2025 at 5:29
Google Sheets, 13 bytes
=CODE("𝞏")
46 bytes without CODE.
=LET(a,--TRUE,b,a+a,c,a+b*b+b,a&b&a-a&c&a&b+c)
31 bytes using ARABIC credit to Squishalot
=ARABIC("CXX")&ARABIC("DCCXIX")
-
\$\begingroup\$ Why you need
a? \$\endgroup\$l4m2– l4m22025-05-22 07:53:08 +00:00Commented May 22, 2025 at 7:53 -
\$\begingroup\$ Don't
+TRUEwork? \$\endgroup\$l4m2– l4m22025-05-22 07:54:55 +00:00Commented May 22, 2025 at 7:54 -
\$\begingroup\$ @l4m2
+TRUEoutputsTRUE.--TRUEis needed to coax it into an integer, so replacing--awith+awill outputTRUE207TRUE9\$\endgroup\$Value Ink– Value Ink2025-05-22 07:58:18 +00:00Commented May 22, 2025 at 7:58 -
\$\begingroup\$ +TRUE doesn't work but you gave me an idea. Thanks. \$\endgroup\$z..– z..2025-05-22 07:58:53 +00:00Commented May 22, 2025 at 7:58
-
1\$\begingroup\$ Except for the first one, this is also an Excel polyglot. For Excel, you have to use
unicodeinstead of justcode. \$\endgroup\$General Grievance– General Grievance2025-05-23 13:00:50 +00:00Commented May 23, 2025 at 13:00
05AB1E, 3 bytes
ŽÍ¿
Simply uses the compressed 52210, which is output implicitly. 🤷
See this 05AB1E tip of mine (section How to compress large integers?) to understand how the compression works.
APL+WIN, 16 bytes
⌽(⍕⎕av⍳']_')~' '
Obtains index positions of ]_ characters in the atomic vector, converts to characters, removes the space and reverses to give 6949
Nekomata, 5 bytes
"Hᶜ"∏
My user ID is 9288.
"Hᶜ"∏
"Hᶜ" The string "Hᶜ" ([72, 129] in Nekomata's custom encoding)
∏ Product (72 * 129 = 9288)
-
\$\begingroup\$ Wow, what a low userid! :) \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 08:22:39 +00:00Commented May 22, 2025 at 8:22
Red, 52 bytes
f: func[s][load debase s]prin rejoin[f"NzU="f"Njgx"]
The straightforward base64 encoding of "75681" contains digits - that's why I ended up joining the encodings of "75" and "681".
JavaScript (Node.js), 32 bytes
_=>[a=(b=-~-~!_)-~b]+~-a+b+~-b+b
Not assuming any char encoding
JavaScript (Node.js), 16 bytes
_=>atob`NzYzMjM`
Use base64. unicode would go longer so not here
PowerShell, 37 bytes
-join("`a",'S','_'|%{[byte][char]$_})
Not strictly a Unicode solution: takes the string representation of some ASCII codes; "`a" is the 'special' character in PS (Alert/Bell, 7)
Three more solutions more in the spirit of Steve's comment "I'd encourage people to also submit an alternative version that doesn't rely on simply decoding a unicode character"
PowerShell, 76 bytes
$o++
$f=$o+(++$o)*$o--
"$([math]::Cos(($o++-shl$f+$f+$f)-$f))"|% S*g(++$o)$f
The cosine of 32763 happens to be -0,783955601801536
This constructs a one, a five, shifts the 1 left by 15 bits, subtracts 5, takes the cosine, turns it into a string, and then invokes Substring(3, 5).
PowerShell, 80 bytes
$t++;$t++
$i=$t*$t*$t
-join$((--$i)
(++$i)
$i/=$t
(--$i)
($i*=$i)
$i++
($i/=$t))
Creates a 2 and then uses a variable to create the digits; the expressions in brackets will also be output, and then -joined to a single string.
PowerShell, 119 bytes
$p="$([math]::PI)"
$t++;$t++
$i=$p.Length
-join$($p[($i-=$t)]
$p[($i-=$t)]
$p[($i-=$t)]
$i-=$t
$p[($i-=$t)]
$p[(--$i)])
This iterates over the first few decimal places of Pi, which contains my user id backwards.
3.14159265358979
^^ ^ ^ ^
R, 29 bytes
`+`=strtoi
"ajde"+("l"+pi^pi)
My user ID is 101276. Converted to base-21 this will be AJDE, which contains no digits 0-9. Now to get 21 I am using the same base-conversion function strtoi with the arguments 'l' and \$π^π\$ which yields 36 (the decimal part is ignored).
R, 62 bytes
b=pi^pi
`^`=strtoi
format(as.Date('d'^b*'d'^b*'f'^b),'%d%m%y')
The second - quite a long solution - outputs the UID as a date without delimiters (December 10th, 1976). The function as.Date receives 2535 as it's argument. Luckily, 2535 is a product of 13 * 13 * 15 and these numbers are obtained by base-36 conversion as shown above.
Zsh, 18 bytes
[
<<<$[$?$#?#ABII]
[ fails with exit code 2, so $? = 2. The string 2 has length 1, so $#? = 1. Then $?$#?#ABII interpets ABII from base 21, which gives 97857.
A translation of GammaFunction's boring solution also works:
Zsh, 12 bytes
<<<$[##𗹁]
Brainfuck: 35
id: 128398
-[>+>+<<-----]>--.+.>+++++.<+.>+.-.
Vyxal 3, 4 bytes
Ꮠ≜ƛd
Same as my v2 answer, except 39425 can be compressed as Ꮠ≜ƛ for 3 bytes instead of 4
Retina 0.8.2, 12 bytes
bhgac
T`l`d
Try it online! Explanation: Inserts the string constant bhgac, then transliterates the letters a-j into the digits 0-9.
-
\$\begingroup\$ Nice, a different strategy from most of the others. \$\endgroup\$Steve Bennett– Steve Bennett2025-05-22 08:40:24 +00:00Commented May 22, 2025 at 8:40
MATLAB / Octave, 22 bytes
disp(['SVSYX'-' ' ''])
Explanation
disp(['SVSYX'-' ' ''])
'SVSYX' % Row vector of chars
-' ' % Subtract this char (space). Converts chars to codepoints
[ ''] % Concatenate with empty string. Converts codepoints to chars
disp( ) % Display
-
1\$\begingroup\$ I was told once by a lecturer : 'Any sufficiently complex Perl program is indistinguishable from line-noise'. With this answer i think i have now discovered the lower limit of 'sufficiently complex' :-) \$\endgroup\$Tony Suffolk 66– Tony Suffolk 662025-05-24 16:27:41 +00:00Commented May 24, 2025 at 16:27
TypeScript (TS type system), 101 88
type L<X>=X["length"]
type _=`${L<[,,,,,,,,,]>}${L<[,]>}${L<[,,,,]>}${L<[]>}${L<[,,,]>}`
Has errors, but type _ is "91403".
Uiua 0.17.0-dev.1, 10 bytes SBCS
/-"%÷η÷τ𝄐"
I decided I wanted to work within Uiua's SBCS, so this computes 117598 using only the values of Uiua+ASCII characters.
/- is an alternating sum of the string, which works since Uiua treats characters as the null character plus their Unicode values.