-5
\$\begingroup\$

The string "node" must be hard-coded in plain ascii to obtain a string with the value "node", which must be transformed into the string "deno".

You cannot include "deno", any other variations, any other subsets of the word "deno", or any other hard-coded representation of it in your code, unless it is part of the string "node" stated above.

New contributor
David Callanan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
  • 3
    \$\begingroup\$ I think you should clarify with the string "node" hard-coded. Do you mean that node must appear in the source code, in plain ASCII? \$\endgroup\$ – Arnauld May 22 at 13:15
  • 6
    \$\begingroup\$ @J42161217 I downvoted them all because all of them are answers to a question I consider terrible enough to be closed and deleted as soon as possible rather than answered. \$\endgroup\$ – my pronoun is monicareinstate May 22 at 13:23
  • 7
    \$\begingroup\$ @mypronounismonicareinstate I upvoted them because the authors of these posts have took effort to make a valid answer to the question. \$\endgroup\$ – Λ̸̸ May 22 at 13:24
  • 6
    \$\begingroup\$ @Λ̸̸ Have just done the same. In my humble opinion, downvoting valid answers to bad questions does not stop bad questions being asked or answered. Vote to close does on the other hand. \$\endgroup\$ – ElPedro May 22 at 14:21
  • 3
    \$\begingroup\$ "any subsets of deno" all current answers are invalid because they contain two two-character subsets! \$\endgroup\$ – my pronoun is monicareinstate May 23 at 6:36

11 Answers 11

5
\$\begingroup\$

Keg, 6 bytes

Seems to be the perfect language for the job!

node''

Try it online!

Explanation

node    Push   : [n, o, d, e]
    '   Roll up: [o, d, e, n]
     '  Roll up: [d, e, n, o]
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice, I was trying to find a way of "rolling" the string \$\endgroup\$ – David Callanan May 22 at 13:38
3
\$\begingroup\$

jq (with -n and maybe -r), 18 characters

"node"|.[2:]+.[:2]

Sample run:

bash-5.0$ jq -nr '"node"|.[2:]+.[:2]'
deno

Try it online!

The same length as the letter sorting "node"/""|sort|add ( Try it online!).

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

MathGolf, 6 bytes

ÿ introduces a length-4 string. s sorts the string.

ÿnodes

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ If I get downvoted with the APL answer, it's worth it. ;) \$\endgroup\$ – Λ̸̸ May 23 at 22:06
2
\$\begingroup\$

APL (Dyalog Extended), 7 bytes

∧'node'

Try it online!

A simple sort.

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

C (gcc), 48 bytes

f(){char*s="node";printf("%s%c%c",s+2,*s,s[1]);}

Try it online!

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

Retina 0.8.2, 9 bytes


node
O`.

Try it online! Explanation:


node

Insert node.

O`.

Sort by characters.

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

Charcoal, 9 bytes

⪫⮌⪪node²ω

Try it online! Link is to verbose version of code. Explanation:

   node     Literal string `node`
  ⪪    ²    Split into pairs of characters
 ⮌          Exchange the pair of pairs
⪫       ω   Join together again
            Implicitly print
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Befunge-93, 13 bytes

"node"\,,\,,@

Try it online!

Push n, o, d, e on the stack, swap the two top elements, print them, swap the two top elements, print them.

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

perl -M5.010, 19 bytes

node=~/../;say$'.$&

Try it online!

Prints the last two characters, then the first two.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Have you intended to post this version with the double quotes? (Asking because without " it would match the size of 19 bytes.) \$\endgroup\$ – manatwork May 22 at 14:07
  • \$\begingroup\$ @manatwork No. Fixed now. \$\endgroup\$ – Abigail May 22 at 14:43
0
\$\begingroup\$

Python, 23 bytes

"".join(sorted("node"))

JavaScript, 27 bytes

[..."node"].sort().join("")

See here by @FremyCompany

Python, 30 bytes

(lambda x:x[2:]+x[:2])("node")

JavaScript, Ruby, 32 bytes

"node".split("").sort().join("")

See here by @deno_land

| improve this answer | |
New contributor
David Callanan is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
  • 3
    \$\begingroup\$ By default, we only accept programs and functions. Not code snippets. \$\endgroup\$ – Arnauld May 22 at 13:11
  • 1
    \$\begingroup\$ the bottom JS solution (32 bytes) is also valid Ruby \$\endgroup\$ – nope May 22 at 13:13
  • 2
    \$\begingroup\$ Though any rubyist would prefer "node".chars.sort*"" instead. \$\endgroup\$ – manatwork May 22 at 14:17
0
\$\begingroup\$

Wolfram Language (Mathematica), 25 bytes

Special thanks to @mypronounismonicareinstate for downvoting my answer and ALL the answers in this post because he/she didn't like the question. nice

"node"~StringRotateLeft~2

Try it online!

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ I thought my pronoun is monicareinstate helped you with golfing this program. \$\endgroup\$ – Λ̸̸ May 22 at 14:09

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