8 add language tag
source | link
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to its author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to its author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to its author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to its author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
7 deleted 271 characters in body
source | link
  • I am using the word "the" in there, but it's not the "the" that gets printed. It might be technically invalid, I'll let the OP decide if the rules have to be this strict for the bonus challenge. If so, then so be it.
  • The word "the" appeared in an earlier version of the code; although the OP said it was okay (because it wasn't that instance of "the" that got printed), I figured out how to comply with all the rules and also (subtly) remind folks about SE's licensing requirements.
  • The rules state I cannot use certain words, but we read from left to right, so I assume having the words written out vertically is valid.
  • I have no idea how I still got this job, seeing the terrible things I write in comments. I mean: riddles, really?
  • I am using the word "the" in there, but it's not the "the" that gets printed. It might be technically invalid, I'll let the OP decide if the rules have to be this strict for the bonus challenge. If so, then so be it.
  • The word "the" appeared in an earlier version of the code; although the OP said it was okay (because it wasn't that instance of "the" that got printed), I figured out how to comply with all the rules and also (subtly) remind folks about SE's licensing requirements.
  • The rules state I cannot use certain words, but we read from left to right, so I assume having the words written out vertically is valid.
  • I have no idea how I still got this job, seeing the terrible things I write in comments. I mean: riddles, really?
  • I am using the word "the" in there, but it's not the "the" that gets printed. It might be technically invalid, I'll let the OP decide if the rules have to be this strict for the bonus challenge. If so, then so be it.
  • The rules state I cannot use certain words, but we read from left to right, so I assume having the words written out vertically is valid.
  • I have no idea how I still got this job, seeing the terrible things I write in comments. I mean: riddles, really?
6 Removed the word "the" from the code, to comply with the rules
source | link
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to it'sits author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to it's author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
# ^ Prime Checker ([>:#,_@| Golf Inc. Ltd. | @_,#:<])
# ^ Ingo Bürk, (C) 2014
################################################################################################
# Input should be a "reasonably"
# small integer, or I can't guarantee
# that the check is fast at all.
#
# More Details:   - the numbers 0 and 1 are
#                   handled as not prime,
#                   even if some people disagree
#
#                 - because my employer prefers shortness                 
#                   over well-tested, modular and
#                   somewhat pretty code, the used method is
#                   somewhat questionable

#                 - first of all, the input is converted
#                   into a string of 1s such that the
#                   number of 1s equals the input;
#                   directly after that, a regexp is applied
#                   such that it checks if the input is prime

#                 - the regexp is not really my work, so I
#                   have to give attribution to its author
#                   if I want to use it here; I got it on
#                   stackoverflow:
#                   "http://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes"

# <=> <--- a riddle^^
    use v5.10;

# Definition of prime number:
#############################
# "A prime is a positive integer with exactly two unique divisors."
# ,
#
# I should mention that input is given via stdin.
#
# quality documentation like this is why I get paid so much.
# use this script at your own risk.
# it has been known that checking primes like this can crash interpreters.
# this never happened to me, though.
# .
# "Less is more" -- Robert Browning (1812-1889) [Riddle Solution]

    print"not "if(1x shift)=~/^1?$|^(11+?)\1+$/;say"prime"
5 Removed the word "the" from the code, to comply with the rules
source | link
4 added 7 characters in body
source | link
3 added 40 characters in body
source | link
2 added 31 characters in body
source | link
    Post Undeleted by Ingo Bürk
    Post Deleted by Ingo Bürk
1
source | link