-5
\$\begingroup\$

So, you're browsing Programming Puzzles & Code Golf, and you see a new challenge. The author (gasp) forgot to say "No standard Loopholes". You decide to take advantage of this situation, and you read the answer from a file/network. However, you need to make sure that your answer is actually shorter than the legitimate answers, so you golf it, too.

The Challenge

Write a complete program that prints out the contents of the file definitelynottheanswer.txt to STDOUT. This text file only contains valid ASCII characters. Alternatively, the program can get the file location from STDIN or command line args. The only input allowed is the file location if you choose to get the location from the user; otherwise, no input is allowed. There is no reward for getting the file location from the user, but the user input of the file location does not count against the byte total (in other words, definitelynottheanswer.txt wouldn't be included in the byte score).

The program must not write to STDERR.

Bonus

Retrieve the file from the internet instead of a file (the URL must be user-supplied). Reward: multiply source length by 0.85

Scoring

  • This is , so the lowest score,program length (bytes) * bonus, wins.
  • No (other) standard loopholes.
  • If the language does not support reading files from disk, it cannot be used (sorry).
\$\endgroup\$

closed as off-topic by Erik the Outgolfer, NoOneIsHere, Michael Klein, DJMcMayhem, Daniel M. Jun 7 '16 at 18:01

  • This question does not appear to be about programming puzzles or code golf within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    \$\begingroup\$ So the task is... read a file? \$\endgroup\$ – Alex A. Oct 9 '15 at 2:57
  • \$\begingroup\$ No- it's "getting the solution from an external source" </s>. This idea sounded a lot better when I was writing it... \$\endgroup\$ – Daniel M. Oct 9 '15 at 3:00
  • 4
    \$\begingroup\$ I recommend using the Sandbox for future challenges. That way you can get feedback before the challenge is posted. \$\endgroup\$ – Alex A. Oct 9 '15 at 3:04
  • 2
    \$\begingroup\$ It should be noted that if a poster doesn't say "No standard loopholes" in their question, they are still forbidden by default unless the OP explicitly allows them. \$\endgroup\$ – mbomb007 Oct 9 '15 at 15:26
  • 4
    \$\begingroup\$ I'm voting to close this question as off-topic because this is basically like code-trolling, but without the tag. \$\endgroup\$ – NoOneIsHere Jun 7 '16 at 16:39
14
\$\begingroup\$

GNU sed, 0 bytes

Even better..

\$\endgroup\$
  • 4
    \$\begingroup\$ Right tool for the job. \$\endgroup\$ – Dennis Oct 9 '15 at 3:14
  • \$\begingroup\$ Well, this is the shortest it can go... \$\endgroup\$ – Daniel M. Oct 9 '15 at 3:15
  • \$\begingroup\$ @DanielM. No, you could make one that's so short it closes the console window, which would make it -1 bytes... not really \$\endgroup\$ – HyperNeutrino Jan 12 '17 at 21:30
2
\$\begingroup\$

Bash, 7 bytes * .85 = 5.9 bytes

curl $1

zzz

\$\endgroup\$
1
\$\begingroup\$

Pyth - 2 bytes * .85 = 1.7

'z

Does not work online.

\$\endgroup\$
1
\$\begingroup\$

Bash, 6 bytes

cat $1

Provide filename as a command line argument. Probably breaks if the argument contains spaces or newlines or weird chars or whatever.

\$\endgroup\$
1
\$\begingroup\$

CJam, 1.7 bytes

qg

For security reasons, this does not work in the online interpreter.

\$\endgroup\$

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