48
\$\begingroup\$

A current internet meme is to type 2spooky4me, with a second person typing 3spooky5me, following the (n)spooky(n+2)me pattern.

Your mission is to implement this pattern in your chosen language. You should write a program or function that takes a value n (from standard input, as a function argument, or closest alternative), and outputs the string (n)spooky(n+2)me (without the parentheses; to standard output, as a return value for a function, or closest alternative).

Your solution should work for all inputs, from 1 up to 2 below your language's maximum representable integer value (2^32-3 for C on a 32-bit machine, for example).

Example implementation in Python:

def spooky(n):
    return "%dspooky%dme"%(n,n+2)

spooky(2) -> "2spooky4me"

This is , so standard loopholes are forbidden, and the shortest answer in bytes wins!

Leaderboard

The Stack Snippet at the bottom of this post generates the leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:

## [><>](http://esolangs.org/wiki/Fish), 121 bytes

<style>body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } table td { padding: 5px; }</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table><script>var QUESTION_ID = 62350; var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk"; var OVERRIDE_USER = 45941; var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page; function answersUrl(index) { return "https://api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER; } function commentUrl(index, answers) { return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER; } function getAnswers() { jQuery.ajax({ url: answersUrl(answer_page++), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { answers.push.apply(answers, data.items); answers_hash = []; answer_ids = []; data.items.forEach(function(a) { a.comments = []; var id = +a.share_link.match(/\d+/); answer_ids.push(id); answers_hash[id] = a; }); if (!data.has_more) more_answers = false; comment_page = 1; getComments(); } }); } function getComments() { jQuery.ajax({ url: commentUrl(comment_page++, answer_ids), method: "get", dataType: "jsonp", crossDomain: true, success: function (data) { data.items.forEach(function(c) { if (c.owner.user_id === OVERRIDE_USER) answers_hash[c.post_id].comments.push(c); }); if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); } getAnswers(); var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/; var OVERRIDE_REG = /^Override\s*header:\s*/i; function getAuthorName(a) { return a.owner.display_name; } function process() { var valid = []; answers.forEach(function(a) { var body = a.body; a.comments.forEach(function(c) { if(OVERRIDE_REG.test(c.body)) body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>'; }); var match = body.match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2], language: match[1], link: a.share_link, }); else console.log(body); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; lang = jQuery('<a>'+lang+'</a>').text(); languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang.toLowerCase(), user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang_raw > b.lang_raw) return 1; if (a.lang_raw < b.lang_raw) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } }</script>

\$\endgroup\$
6
  • 3
    \$\begingroup\$ For bonus points: Input %dspooky%dme, validate and return next in series. \$\endgroup\$
    – clapp
    Oct 31, 2015 at 6:13
  • 27
    \$\begingroup\$ True, but Dennis would still win \$\endgroup\$
    – clapp
    Oct 31, 2015 at 6:19
  • 10
    \$\begingroup\$ Who is Dennis? :O \$\endgroup\$
    – NuWin
    Feb 15, 2016 at 20:39
  • 17
    \$\begingroup\$ @NuWin Dennis is the way. Dennis is the light. \$\endgroup\$
    – Alex A.
    Feb 15, 2016 at 23:02
  • 2
    \$\begingroup\$ @NuWin Dennis is love, Dennis is life \$\endgroup\$
    – user63571
    Jan 25, 2017 at 19:40

120 Answers 120

46
\$\begingroup\$

gs2, 15 bytes

I outgolfed Dennis!

CP437:

spooky•me♣╨V↕0B

Hex dump:

73 70 6f 6f 6b 79 07 6d 65 05 d0 56 12 30 42

At the start of the program, STDIN is pushed (e.g. the string "3") and stored in variable A. The first ten bytes of the program push two strings, "spooky" and "me", to the stack. Then:

  • d0 pushes variable A.
  • 56 parses it as a number.
  • 12 30 increments it by two.
  • 42 swaps the top two elements on the stack, leaving "3" "spooky" 5 "me".

The final stack is printed as 3spooky5me.

\$\endgroup\$
5
  • 4
    \$\begingroup\$ Holy hell, that's short. +1 \$\endgroup\$ Oct 31, 2015 at 23:47
  • 13
    \$\begingroup\$ GJ, but Dennis might come over here and outmod you to preserve his reputation. \$\endgroup\$
    – TheDoctor
    Oct 31, 2015 at 23:48
  • 8
    \$\begingroup\$ What no how how did you do that \$\endgroup\$ Nov 1, 2015 at 2:06
  • 3
    \$\begingroup\$ I just realized... does gs2 stand for "golf script 2"? \$\endgroup\$
    – mbomb007
    Nov 3, 2015 at 14:56
  • 7
    \$\begingroup\$ By the way, I've added GS2 to my family of online interpreters, Try it online! \$\endgroup\$
    – Dennis
    Dec 11, 2015 at 22:57
29
\$\begingroup\$

GS2, 17 bytes

56 40 27 27 04 73 70 6F 6F 6B 79 05 42 04 6D 65 05

I CAN'T OUTGOLF DENNIS HELP

\$\endgroup\$
2
  • 32
    \$\begingroup\$ relevant \$\endgroup\$
    – Downgoat
    Oct 31, 2015 at 3:24
  • 4
    \$\begingroup\$ Man, it's so weird that we currently have 4 languages tied for first and 3 languages tied for second :P \$\endgroup\$ Oct 31, 2015 at 20:15
25
\$\begingroup\$

Stuck, 17 bytes

i_2+"spooky";"me"

EDIT: GUESS YOU COULD SAY I'M STUCK AT 17 BYTES

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Hey cool, someone actually using Stuck :D \$\endgroup\$
    – Kade
    Nov 1, 2015 at 0:31
  • \$\begingroup\$ @Shebang I actually really like Stuck. Although it would be nice if it had some better methods for manipulating arrays. \$\endgroup\$ Nov 1, 2015 at 2:07
21
\$\begingroup\$

GolfScript, 17 bytes

~.2+"spooky"\"me"

Try it online on Web GolfScript.

How it works

~.2+"spooky"\"me"
~                 # Evaluate the input.
 .2+              # Push a copy and add 2.
    "spooky"      # Push that string.
            \     # Swap it with the computed sum.
             "me" # Push that string.
\$\endgroup\$
16
\$\begingroup\$

Chef, 414 bytes

S.

Ingredients.
g i
2 g t
115 l s
112 l p
111 l o
107 l k
121 l y
109 l m
101 l e

Method.
Take i from refrigerator.Put e into mixing bowl.Put m into mixing bowl.Put i into mixing bowl.Add t.Put y into mixing bowl.Put k into mixing bowl.Put o into mixing bowl.Put o into mixing bowl.Put p into mixing bowl.Put s into mixing bowl.Put i into mixing bowl.Pour contents of mixing bowl into the baking dish.

Serves 1.

A recipe for disaster. Do not try this at home.

\$\endgroup\$
1
  • 10
    \$\begingroup\$ Mm. That's some spooky tastes you got there. \$\endgroup\$ Nov 8, 2015 at 15:36
11
\$\begingroup\$

Pyth - 17 bytes

s[Q"spooky"hhQ"me

Try it online here.

\$\endgroup\$
11
\$\begingroup\$

Pip, 18 bytes

Looks like I'm in the second tier of golfing languages here. :^P

[a"spooky"a+2"me"]

Try it online!

Takes the number as a command-line argument and puts the appropriate elements in an array, which is joined together and autoprinted at the end of the program.


Five and a half years later, here's a much more interesting 18-byte solution:

"0spooky2me"RXD_+a

Try it online!

In the string 0spooky2me, Replace each digit (built-in regex variable XD) with itself plus the command-line argument (_+a).

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

CJam, 18 bytes

ri_2+"spooky"\"me"

Try it online.

\$\endgroup\$
9
\$\begingroup\$

TeaScript, 18 bytes

x+`spooky${x+2}me`

Unfortunately this string can't be compressed so this is basically as short as it will get

\$\endgroup\$
1
  • 15
    \$\begingroup\$ Welcome to the 18th byte! :P \$\endgroup\$ Oct 31, 2015 at 2:36
8
\$\begingroup\$

dc, 20 bytes

?dn[spooky]P2+n[me]P
\$\endgroup\$
8
\$\begingroup\$

Japt, 17 16 bytes

U+"spooky{U+2}me

Japt (Javascript shortened) is a language of my invention. It is newer than this challenge; thus, this answer is non-competing. Unlike my other seven unpublished languages, this one has an actual interpreter that is currently being developed and is already partially working.

I wanted to post this because I like how it's the same length as all the existing first-place second-place answers. Here's how it works:

U+"spooky{U+2}me"    implicit: [U,V,W,X,Y,Z] = eval(input)
U+                   input +
  "spooky     me"     this string
         {U+2}         with input+2 inserted here
                     implicit: output last expression

And there you have it. The spec for all functionality used here was finalized on Oct 29th; nothing was changed to make this answer any shorter. Here's the interpreter, as promised.

\$\endgroup\$
1
  • \$\begingroup\$ I'm sure this was pre-shoco, but I think you could've done {U}2me instead of {U+2}me :P \$\endgroup\$
    – Oliver
    May 1, 2018 at 18:27
7
\$\begingroup\$

05AB1E, 14 10 bytes

DÌs’ÿæªÿme

Try it online.

Explanation

DÌs’ÿæªÿme

D                get input n and duplicate it
 Ì               increment by 2
  s              Swap. Stack is now [n+2, n].
   ’ÿæªÿme       Compressed string that expands to "ÿspookyÿme". The first ÿ is then replaced by n and the second by n+2.
\$\endgroup\$
1
  • 3
    \$\begingroup\$ This seems to work with D removed for 9 bytes \$\endgroup\$
    – dzaima
    Nov 10, 2017 at 20:09
6
\$\begingroup\$

Julia, 23 bytes

n->"$(n)spooky$(n+2)me"

This creates an unnamed lambda function that accepts an integer and returns a string. The output is constructed using Julia's string interpolation.

\$\endgroup\$
6
\$\begingroup\$

Gol><>, 21 bytes

I:n"emykoops"6Ro{2+nH

I guess I'm... tied with Perl? Try it online.

I:n            Input n, output n
"emykoops"     Push chars
6Ro            Output top 6 chars (spooky)
{2+n           Output n+2
H              Output stack and halt (me)
\$\endgroup\$
6
\$\begingroup\$

Vitsy, 21 Bytes

Note: the Z command was made after this challenge began, but was not made for this challenge.

VVN"ykoops"ZV2+N"em"Z
V                      Grab the top item of the stack (the input) and make it a
                       global variable.
 V                     Call it up - push the global variable to the top of the stack.
  N                    Output it as a number.
   "ykoops"            Push 'spooky' to the stack.
           Z           Output it all.
            V2+N       Call the global variable again, add two, then output as num.
                "em"Z  Push 'me' to the stack and output it all.

More spoopy variation using multiple stacks (27 Bytes):

&"ykoops"&"em"?DN?Z??2+N??Z

&                           Make a new stack and move to it.
 "ykoops"                   Push 'spooky' to the current stack.
         &"em"              Do the last to things with 'me'.
              ?             Move over a stack.
               DN           Output the input.
                 ?Z         Move over a stack (the one with 'spooky') and print it.
                   ??       Move back to the original stack.
                     2+N    Add 2 to the input and output it as a number.
                        ??Z Move to the stack with 'me' in it and print it.

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Just wondering, why are strings inverted? \$\endgroup\$
    – Cyoce
    Feb 23, 2016 at 2:32
  • \$\begingroup\$ It's pushing chars to the stack one by one. \$\endgroup\$ Mar 23, 2016 at 8:45
6
\$\begingroup\$

Jelly

13 bytes

+0,2ż“×¥X“ŀ`»

I CAN'T OUTGOLF QUARTATA HELP

Try it online!

How it works

+0,2ż“×¥X“ŀ`»  Main link. Input: n

+0,2           Add [0, 2] to n, resulting in [n, n + 2].
     “×¥X“ŀ`»  Yield ['spooky, 'me'] by indexing into a dictionary.
    ż          Zip the results to left and right with each other.
               This yields [[n, 'spooky'], [n + 2, 'me']], which is flattened
               before printing.
\$\endgroup\$
2
  • 9
    \$\begingroup\$ One does not simply outgolf... quartata? \$\endgroup\$
    – Arcturus
    Mar 31, 2016 at 2:23
  • 1
    \$\begingroup\$ I can't seem to outgolf quartata, but, since the answer is non-competing, I can give some help. +2ṭż“×¥X“ŀ`» \$\endgroup\$ Feb 15, 2017 at 17:45
5
\$\begingroup\$

Ruby, 25 bytes

->n{"#{n}spooky#{n+2}me"}

This creates an unnamed lambda that accepts an integer and returns a string. The string is constructed using Ruby's string interpolation.

\$\endgroup\$
5
\$\begingroup\$

APL, 25 22 bytes

⍕,'spooky','me',⍨∘⍕2+⊢

This creates an unnamed monadic function train that accepts an integer on the left and returns a string.

Numeric values are converted to strings using . The array of strings is joined into a single string using .

Try it online

Saved 3 bytes thanks to Thomas Kwa!

\$\endgroup\$
0
5
\$\begingroup\$

Javascript(ES6) 23 21 Bytes

A simple function that will be crushed by golfing lanqs:

_=>_+`spooky${_+2}me` 

_=>`${_}spooky${_+2}me`

Special thanks to ETHproductions for saving 2 bytes

\$\endgroup\$
3
  • \$\begingroup\$ NOICE! You might be able to shorten the template strings, but I can't think of any way to do so \$\endgroup\$
    – bren
    Oct 31, 2015 at 17:21
  • \$\begingroup\$ Two bytes saved: _=>_+`spooky${_+2}me` \$\endgroup\$ Oct 31, 2015 at 20:18
  • \$\begingroup\$ Thank you, but now the fix seems so obvious I feel stupid. I think this is the shortest possible way to do this in Javascript, I could be wrong( I hope I'm wrong) \$\endgroup\$ Oct 31, 2015 at 21:11
4
\$\begingroup\$

PHP, 55 47 46 42 34 bytes

<?=($a=$argv[1]).spooky.($a+2).me;

Accepts the number as command line input.

Credits :)

Thanks to manatwork for saving 4 bytes!

Thanks to insertusernamehere for saving 8 bytes!

\$\endgroup\$
2
  • \$\begingroup\$ function a($a){echo$a,"spooky",$a+2,"me";} \$\endgroup\$
    – manatwork
    Oct 31, 2015 at 12:25
  • \$\begingroup\$ You could save 4 bytes by removing the "s. You could even save 4 more bytes by taking a command line argument and discard the function, like this: <?=($a=$argv[1]).spooky.($a+2).me;. \$\endgroup\$ Oct 31, 2015 at 20:07
4
\$\begingroup\$

Chaîne, 15 bytes

noncompeting, language postdates question

{i~}:-,}:{2+}me
{i~}            | input duplicate write
    :   :       | access dictionary with inner base-93 key
     -,}        | entry for "spooky"
         {2+}   | push 2, add previous two, write
             me | write me

Implicit output.

\$\endgroup\$
3
  • \$\begingroup\$ The output is `spookyme 4 2" (newline separated) \$\endgroup\$ Nov 1, 2015 at 10:35
  • \$\begingroup\$ @fschmengler I must have messed something up whilst updating the interpreter. Please stand by. \$\endgroup\$ Nov 1, 2015 at 17:11
  • \$\begingroup\$ @fschmengler Alright, bugs have been fixed. It should work now. \$\endgroup\$ Nov 1, 2015 at 17:17
3
\$\begingroup\$

Simplex v.0.7, 20 bytes

Simplex simply isn't feeling golfy today. >_<

i@R"spooky"&IIR"me"g
i@                   ~~ take input and copy to register
  R"spooky"          ~~ write that string to the strip (increment byte after every character)
           &II       ~~ write the register (incremented twice) to the strip
              R"me"  ~~ write that string to the strip
                   g ~~ output the strip
\$\endgroup\$
6
  • \$\begingroup\$ You still beat Vitsy. o-o \$\endgroup\$ Oct 31, 2015 at 15:53
  • \$\begingroup\$ @VoteToClose Don't feel too bad. Last Simplex version would've been ~25+ characters. Either way, 20 or 21 bytes doesn't come close to 17 ;-; \$\endgroup\$ Oct 31, 2015 at 16:00
  • 2
    \$\begingroup\$ Dennis wins again. \$\endgroup\$ Oct 31, 2015 at 16:02
  • 1
    \$\begingroup\$ @VoteToClose What did you expect? He's a mod XD \$\endgroup\$ Oct 31, 2015 at 16:02
  • 3
    \$\begingroup\$ We need to add this to the meme list. \$\endgroup\$ Oct 31, 2015 at 16:03
3
\$\begingroup\$

C, 58 bytes

main(a,b)char**b;{printf("%sspooky%dme",*++b,atoi(*b)+2);}

atoi() may be unnecessary.

\$\endgroup\$
1
  • \$\begingroup\$ 1. Fails on my gcc, because it depends on evaluation order. 2. Save a byte with int**b. \$\endgroup\$
    – ugoren
    Nov 3, 2015 at 15:11
3
\$\begingroup\$

Mathematica, 45 27 bytes

Print[#,"spooky",#+2,"me"]&

g=ToString[#]<>"spooky"<>ToString[#+2]<>"me"&

Thanks to Martin Büttner for the significant improvement (and the warm welcome).

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Welcome to PPCG! Unnamed functions are fine, so you don't need the g= and I think Print[#,"spooky",#+2,"me"]& should work as well. :) \$\endgroup\$ Oct 31, 2015 at 14:19
  • \$\begingroup\$ What about Row@{#,spooky,#+2,me}&? The output is visually similar if the variables are not defined. \$\endgroup\$ Nov 1, 2015 at 7:06
3
\$\begingroup\$

Minkolang 0.10, 49 bytes

I have no way to convert integers to strings (yet!), so this is much longer.

"me"nd2+(dl%"0"+$rl:d)"spooky"2g(dl%"0"+$rl:d)$O.

Try it here.

Explanation

(dl%"0"+$rl:d) does the job of converting an int to a string. If this were replaced by a single character (like Z), then my solution would be just 23 bytes.

"me"nd2+Z"spooky"2gZ$O.

nd takes an integer from input and duplicates it. 2+ adds 2 and 2g later gets the initial input and puts it on top of stack. $O. outputs the whole stack as integers and stops.

\$\endgroup\$
2
  • \$\begingroup\$ Surely it's shorter to just output the numbers as numbers? \$\endgroup\$
    – Sp3000
    Nov 1, 2015 at 7:49
  • \$\begingroup\$ Outputting as number automatically adds a space to the output. So it'd be "2 spooky4 me". \$\endgroup\$ Nov 1, 2015 at 20:50
3
\$\begingroup\$

Lua for windows, 41 bytes

n=io.read()print(n.."spooky"..n+2 .."me")

test with lua for windows

it takes the input through io.read then stored in variable n then on the same line prints the variable n then "spooky" then n+2 finally it prints "me"

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Remove whitespace and save bytes n=io.read()print(n.."spooky"..n+2.."me") \$\endgroup\$
    – Veer Singh
    Oct 31, 2015 at 15:44
  • 1
    \$\begingroup\$ @DigitalVeer - Without the whitespace 2. will be treated as a number. \$\endgroup\$ Nov 1, 2015 at 9:30
  • \$\begingroup\$ p.lua: print(.....'spooky'.. ...+2 ..'me') How to run: lua51.exe p.lua 2 Size = 35 bytes. \$\endgroup\$ Nov 1, 2015 at 9:37
3
\$\begingroup\$

Rotor, 15 bytes

&"spooky"~2+"me

Language was created after the challenge. Does not work in the online interpreter (uses input eval.)

\$\endgroup\$
3
  • \$\begingroup\$ Dam son. You outgolfed Dennis. Finally. Hooray! \$\endgroup\$ Jan 10, 2016 at 6:15
  • 1
    \$\begingroup\$ Rotor is dead to me don't try to resurrect it please. \$\endgroup\$ Jan 10, 2016 at 15:09
  • 1
    \$\begingroup\$ Nice job, even in Rotor!! You should reward it with life. \$\endgroup\$
    – Riker
    Mar 22, 2016 at 21:33
3
\$\begingroup\$

Perl 5, 20 19 bytes

$\=spooky.($_+2).me

The code requires the -p switch. Thanks to @Xcali for golfing off 1 byte!

Try it online!

\$\endgroup\$
0
3
\$\begingroup\$

Factor, 30 bytes

[ dup 2 + [I ${}spooky${}meI]]

TIO doesn't have the interpolate vocab, so have a screenshot:

enter image description here

\$\endgroup\$
3
\$\begingroup\$

Vim, 18 17 bytes

C<C-r>"spooky<C-r>"<esc><C-a><C-a>ame

Try it online!

Explanation

C

Delete the input number (storing it in the register) and enter insert mode.

<C-r>"spooky<C-r>"

Insert the number from the register, followed by spooky, followed by the number from the register again.

<esc><C-a><C-a>

Leave insert mode and increment the number under the cursor twice.

ame

Insert me after the number.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.