43
\$\begingroup\$

You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way onto their database server, and find where the values for the minimum and maximum amounts are held. You decide to plug 25 '9's in as the maximum value, but get an error message saying the maximum value must be of type 'uint64'. However it is now that you notice some number keys don't seem to type into the remote console correctly. The challenge appears before you almost as if typed up on a Q+A site.

using only the conveniently installed programs for testing and executing your particular language, output the maximum size of an unsigned 64-bit integer value, however almost everything except the programming tools are broken on this machine, leaving you without the use of the numbers 1,2,4,6,8 - in either source code or literals, you also notice that it seems to take an exponentially longer amount of time to execute the program for each additional piece of code, so you'd better keep it short if you want to get rich before the drawing!


The Challenge

  • Write a program which outputs 18446744073709551615, the maximum value of an unsigned 64-bit integer, as either a number, or a single string.

  • Your source code cannot contain any of the characters '1','2','4','6' or '8'

  • if your language does not have an unsigned 64-bit integer or equivalent, the output can be in string format or otherwise, but must be the above number.

  • this is so shortest code in each language wins!

\$\endgroup\$
  • 14
    \$\begingroup\$ predefined values. pfft \$\endgroup\$ – Matthew Roh Feb 21 '17 at 12:29
  • \$\begingroup\$ can output be a hexadecimal number? \$\endgroup\$ – user902383 Feb 21 '17 at 13:25
  • 1
    \$\begingroup\$ @user902383 must be in the exact format, feel free to parse it as a hex number, as long as the output is in normal decimal notation. \$\endgroup\$ – colsw Feb 21 '17 at 14:16
  • 10
    \$\begingroup\$ I love the story lol. More challenges need a backstory like this \$\endgroup\$ – Cruncher Feb 22 '17 at 14:40
  • 2
    \$\begingroup\$ So now that there are many solutions to choose from, was the gambling site a fraud? \$\endgroup\$ – Tominator Feb 23 '17 at 10:32

67 Answers 67

1 2
3
0
\$\begingroup\$

SmileBASIC, 35 bytes

?POW(!.+!.,#X)LOCATE #A,0?ASC("x")

x should be replaced with CHR$(1615)

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

Groovy, 28 Bytes

{++(Long.MAX_VALUE​/0.5​)​}​

Try it: https://groovyconsole.appspot.com/edit/5145694419550208

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

GO 62 bytes

package main
import ("fmt")
func main(){fmt.Print(^uint64(0))}

(This is my first submit too)

|improve this answer|||||
\$\endgroup\$
  • 3
    \$\begingroup\$ Your source code contains '6' and '4' I'm afraid. \$\endgroup\$ – Wilfred Hughes Feb 25 '17 at 15:28
  • \$\begingroup\$ I'm blind. Thanks for that. \$\endgroup\$ – Brad McCormack Mar 1 '17 at 3:06
0
\$\begingroup\$

Ruby, 18 bytes

p (9+7)**(9+7)-7/7
|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Would (9+7)**(9+7) save you a byte? \$\endgroup\$ – Neil Feb 21 '17 at 22:49
0
\$\begingroup\$

AWK, 39 bytes

{$0=(a+=++a)^(a*=a*=a*a);sub(".$",5)}1

Usage:

awk '{$0=(a+=++a)^(a*=a*=a*a);sub(".$",5)}5' <<< "anything one line here"

Annoyingly AWK has trouble with integer math beyond 2^53 since it internally converts large integers to 64-bit doubles. Since 2^64 can be exactly represented as a double, its string representation should be exactly 18446744073709551616 (it is on my machine, anyway). Unfortunately, 2^64 - 1 == 2^64, so I could not simply decrement the value, hence the workaround via string substitution.

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

Java, 92 Bytes :-D

class a{public static void main(String[] a){System.out.print(Long.toUnsignedString(-3/3));}}
|improve this answer|||||
\$\endgroup\$
-1
\$\begingroup\$

Python, 20 (or 26) bytes

(5-3)**ord('@')-3**0

ord('@') is equal to 64.

The full function/programme (@BusinessCat, I hope this is more in line with what is expected) would add 6 bytes:

print (5-3)**ord('@')-3**0

The 26 byte version would work if we wanted to pipe the output:

python -c "print (5-3)**ord('@')-3**0"

The 20 byte version would not.

|improve this answer|||||
\$\endgroup\$
  • 1
    \$\begingroup\$ This is a snippet, every submission needs to be a full program or function. \$\endgroup\$ – Business Cat Feb 27 '17 at 14:19
1 2
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.