-11
\$\begingroup\$

Write a program that has at least one byte that, when run, does absolutely nothing. I thought this would be done by now, but I can't find any other challenges like this.

How to tell if it does nothing:

  • No variables are declared
  • Nothing is returned
  • Input does nothing
  • You could run a program after it and it would run normally
  • It's like you never ran it in the first place

That's it.

\$\endgroup\$
4
  • 8
    \$\begingroup\$ I'd recommend using the sandbox for future challenges. \$\endgroup\$ Mar 21, 2023 at 14:08
  • \$\begingroup\$ Pretty much any C-family language, 1 byte: just a space \$\endgroup\$
    – Bbrk24
    Mar 21, 2023 at 14:12
  • \$\begingroup\$ @Bbrk24 Not quite, many require you to define a main() function or similar--but in those that don't, this can be 0 bytes \$\endgroup\$
    – noodle man
    Mar 21, 2023 at 14:39
  • 2
    \$\begingroup\$ So do we count "use up CPU cycles" as "nothing?" How do you qualify "run normally," and "like you never ran it?" If I run this program from the terminal, it will keep a record. What if the subsequent program "normally" depends on terminal history? \$\endgroup\$ Mar 21, 2023 at 16:39

1 Answer 1

1
\$\begingroup\$

Polyglot, 1 byte



Just a newline. This program does nothing in many languages, including JavaScript, Python 3, the list goes on

\$\endgroup\$
2
  • 3
    \$\begingroup\$ The challenge says "at least one byte". \$\endgroup\$
    – Bbrk24
    Mar 21, 2023 at 14:43
  • 1
    \$\begingroup\$ @Bbrk24, Oops, will fix \$\endgroup\$
    – noodle man
    Mar 21, 2023 at 14:50

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