Here is an easy-intermediate challenge for anyone interested!

What is that?

A thing me and brother do a bit too often is this:

One of us has a problem and asks the other to explain how to do certain stuff. The other just says the following carelessly:

How to <verb> in <n> easy steps!
                                   (Newline mandatory)
Step 1 - Do not <verb>.
Step 2 - Do not <verb>.
Step 3 - Do not <verb>.
Step <n> - <verb>.                 (Capitalised)

For example, if my brother could not find a pen to write with (Do not ask me why) and asked How do I find a pen?, I would probably answer:

How to find a pen in 10 easy steps!

Step 1 - Do not find a pen.
Step 2 - Do not find a pen.
Step 3 - Do not find a pen.
Step 4 - Do not find a pen.
Step 5 - Do not find a pen.
Step 6 - Do not find a pen.
Step 7 - Do not find a pen.
Step 8 - Do not find a pen.
Step 9 - Do not find a pen.
Step 10 - Find a pen.

Sarcasm alert!
Now isn't that so accurate and helpful!

<verb> is the problem one of us wants to achieve.

<n> is a random number that we choose (for your information, we mostly use 10 as <n>, but that is not important for this challenge).

So what?

Your challenge is to write a usual program or function using standard I/O and golfing rules that takes in a string formatted with "How do I <v>?" as input, and then print or return the (accurate) how-to article specified according to the rules displayed above, where <verb> is <v> from the input, and <n> is any random natural number from the range 1 to 10 (inclusive) generated by your program. When <n> is 1, remove the ending s in ...steps!.

Standard loopholes are not allowed!

Note: There might be some cases where sentences will be illogical, like in the case of How do I find my pen?. Outputting How to find my pen in <n> easy steps is fine!

Here is another example for further clarity:

Input -

How do I make coffee?

Example output -

How to make coffee in 3 easy steps!

Step 1 - Do not make coffee.
Step 2 - Do not make coffee.
Step 3 - Make coffee.

Good luck!

  • 1
    \$\begingroup\$ Can we assume that <verb> will always start with a lowercase letter? \$\endgroup\$ – Gymhgy Oct 15 '20 at 18:35
  • 7
    \$\begingroup\$ @SunnyMoon Oh well, that renders all existing answers wrong. \$\endgroup\$ – Adám Oct 15 '20 at 19:42
  • 3
    \$\begingroup\$ I don't think the randomness adds anything to the challenge. Taking a number as input would have made much more sense. \$\endgroup\$ – Sisyphus Oct 16 '20 at 5:18
  • 2
    \$\begingroup\$ @Sisyphus I have not seen much a challenge involving random numbers in CGCC, so I thought I would make one! \$\endgroup\$ – SunnyMoon Oct 16 '20 at 5:37
  • 2
    \$\begingroup\$ @Sisyphus In real life, though, the only input one sibling would take is the verb, and they'd randomly decide how many steps to use :) \$\endgroup\$ – user Oct 21 '20 at 15:23

23 Answers 23


LaTeX, 269 bytes

\input tikz.tex\let\s\pgfmathsetmacro\pgfmathsetseed{\number\pdfrandomseed}\def\u#1{\uppercase{#1}}\def\f
How do I #1?{\s\n{random(0,9)}\s\m{int(\n+1)}How to #1 in \m~easy
step\ifnum\m>1s!\\\\\foreach\i in{1,...,\n}{Step \i~- Do not #1.\\}\else!\\\\\fi
Step \m~- \u#1.}

Random numbers aren't very nice to handle in LaTeX.

Example output:

enter image description here

  • \$\begingroup\$ I always suspected that LaTeX code is ment for golfing rather than actually working with it. :) \$\endgroup\$ – Zsolt Szilagy Oct 18 '20 at 12:37

Bash + coreutils seq, 128

  • Thanks to @NahuelFouilleul for some good golfing suggestions.
echo "How to $v in $[m=(n=$$%10)+1] easy step${s::n}!

`seq -f"Step %g - Do not $v." $n`
Step $m - ${v^}."

Try it online!

  • 1
    \$\begingroup\$ I'm just trying to imagine a How to article with 32767 steps. "Do not find a pen, Do not find a pen, Do not find a pen ... And finally, find a pen!" \$\endgroup\$ – user Oct 15 '20 at 18:46
  • \$\begingroup\$ OP now requires removing "s" if n=1. \$\endgroup\$ – Adám Oct 15 '20 at 19:55
  • 2
    \$\begingroup\$ What does ${$: -1} do? \$\endgroup\$ – corvus_192 Oct 15 '20 at 21:21
  • 2
    \$\begingroup\$ $$ is a variable containing the PID of bash interpreter. The ${varname: -1} expansion gives the last character of the variable. So here the last digit of the PID is used as the "random" number. \$\endgroup\$ – Digital Trauma Oct 15 '20 at 21:29
  • \$\begingroup\$ 9 bytes could be saved \$\endgroup\$ – Nahuel Fouilleul Oct 16 '20 at 20:24

APL (Dyalog Extended), 99 bytes

Full program. Prompts for string from stdin.

∊'How to'(¯1↓v←8↓⌽'.'@1⌽⍞)' in'n'easy step','s!'↓⍨1=n←?10
{∊'Step'⍵'- Do not'v}⍤0⍳n-1

Try it online!

ϵnlists (flattens) the list of components of each line. By default, numbers are printed with one spaces between them and adjacent text. Lines are implicitly printed.

The variable parts are:


?10 random number in range 1–10
n← assign to n
1= is 1 equal to that? (1 if yes, 0 if no)
's!'↓⍨ drop that many characters from "s!"
, prepend the additional components on the left


 prompt for string
'.'@1 replace the character at index 1 with a period.
8↓ drop the first 8 characters ("How do I")
v← assign to v
¯1↓ drop the last character (".")

 empty numeric list (prints as empty line)


n-1 subtract 1 from n
 indices 1–(n−1)
{}⍤0 merge into a matrix the results from applying the following lambda on each element:
 the argument (current index)


⊢v on v
⌈@2 uppercase the second character (there's a leading space in v)
, prepend the components


C (gcc), 186 bytes

n;f(m){char*s;scanf("%m[^?]",&s);for(printf("How to%s in %d easy step%s!\n\n",memcpy(++s," Do not",7)+7,m=++n,"s"+!(n=time()%10));n--;printf("Step %d -%s.\n",m-n,(n||(1[s+=7]^=32),s)));}

Try it online!

+14 bytes due to removing the last s in ...steps! when n=1

-2 bytes by using lseek

-2 bytes by changing conditions

-1 byte by removing a space m- --nm-n--

-3 bytes thanks to Arnauld

-1 byte by changing the last condition from n+1 to !n

-31 bytes thanks to ErikF

-2 bytes by removing s in %m[^?]s and by removing space in "Do not "

-2 bytes thanks to ceilingcat

-1 byte thanks to ErikF

  • 1
    \$\begingroup\$ There are two newlines after ...steps!. \$\endgroup\$ – SunnyMoon Oct 15 '20 at 20:11
  • 2
    \$\begingroup\$ You can use "s"+!n instead of n?"s":"". \$\endgroup\$ – Arnauld Oct 15 '20 at 22:47
  • 1
    \$\begingroup\$ You can use How to%s and (b=a)+6. \$\endgroup\$ – Arnauld Oct 15 '20 at 22:55
  • 1
    \$\begingroup\$ You can save 31 bytes by having scanf give you an allocated string (and also stop at the question mark), and then overwriting the first bit, and reordering the initializations a bit; also golf submissions don't have to be complete programs: Try it online! \$\endgroup\$ – ErikF Oct 16 '20 at 3:50
  • 1
    \$\begingroup\$ 186 bytes by using the interesting subscripting feature that C has where a[1] == 1[a] \$\endgroup\$ – ErikF Oct 22 '20 at 1:07

Ruby -p, 141 140 137 131 bytes

Saved 3 bytes by using $$%10 instead of rand(10), a golf suggested by @NahuelFouilleul in comments on other answers.

$_="How to #{v=$_[9..-2]} in #{n=1+$$%10} easy ste#{:ps[0,n]}!
Step #{i} - #{i<n ?'Do not '+v:v.capitalize}."}*''

Try it online!

  • \$\begingroup\$ I got most of the plain parts, but I'm wondering what did you meant by $_, and I tried to replace it by some var v, which gave error :P \$\endgroup\$ – vrintle Nov 21 '20 at 15:11
  • 1
    \$\begingroup\$ @vrintle You'll often see $_/-p in Ruby/Perl golf because they basically let us read and print strings for free. $_ is a predefined global variable (inherited from Perl) that is automatically set to the last line read by gets or readline. The -p command-line flag causes the code to be wrapped in a while gets; ...; print $_; end loop. If ... is empty you have a cat program: each line from STDIN is printed to STDOUT. The fun starts when you use ... to modify $_ so it prints something different from what was read in. \$\endgroup\$ – Dingus Nov 22 '20 at 0:28
  • \$\begingroup\$ And, how does this works? Even, we've not specified $_. But, when I write just upcase in code, it gives error... Strange! \$\endgroup\$ – vrintle Nov 30 '20 at 10:11
  • 1
    \$\begingroup\$ @vrintle See this tip. In -p mode, sub operates on $_ if there is no explicit receiver. Note that you have specified $_ in your example: it's try it Online, read automatically from STDIN into $_ thanks to -p. \$\endgroup\$ – Dingus Nov 30 '20 at 10:28
  • \$\begingroup\$ (@vrintle I should mention a subtle gotcha: receiverless sub in -p mode modifies $_ in place if substitution occurs. In other words, it behaves differently from $_.sub, which performs substitutions on a copy of $_ and leaves $_ itself unchanged.) \$\endgroup\$ – Dingus Nov 30 '20 at 11:30

Scala, 195 188 bytes

q=>{val(r,s"How do I $v?")=(math.random*10).toInt+1->q
1 to r-1 map{i=>s"Step $i - Do not $v."}mkString(s"How to $v in $r easy ste${"ps"take r}!\n\n","\n",s"\nStep $r - ${v.capitalize}.")}

Here it is in Scastie, but double newlines don't work there for whatever reason.

Equivalent version with newlines in TIO (modified for Scala 2.10)

  • 1
    \$\begingroup\$ Nice use of the string pattern match. \$\endgroup\$ – corvus_192 Oct 15 '20 at 19:01
  • 1
    \$\begingroup\$ OP now requires removing "s" if n=1. \$\endgroup\$ – Adám Oct 15 '20 at 19:55
  • 1
    \$\begingroup\$ You can save 4 bytes with "s"take(r-1) \$\endgroup\$ – corvus_192 Oct 15 '20 at 20:52
  • 2
    \$\begingroup\$ Even better, use "ps"take r \$\endgroup\$ – corvus_192 Oct 15 '20 at 20:54
  • 1
    \$\begingroup\$ I thought the bytecount is one too high, so I thought you counted a newline after the last }, but it's correct now. \$\endgroup\$ – corvus_192 Oct 15 '20 at 21:05

JavaScript (ES6), 159 bytes

Step ${i} - ${i-n?'Do not'+s:s[1].toUpperCase()+s.slice(2)}.`:`How to${s=s.slice(8,-1)} in ${n} easy step${n>1?'s':''}!
`)(n=new Date%10+1)

Try it online!

  • \$\begingroup\$ OP now requires removing "s" if n=1. \$\endgroup\$ – Adám Oct 15 '20 at 19:55
  • \$\begingroup\$ @Adám Thank you for the notification. Updated. \$\endgroup\$ – Arnauld Oct 15 '20 at 22:37

C# (Visual C# Interactive Compiler), 180 bytes

s=>{int y=new Random().Next(10)+1,i=0;for(Write($"How to{s=s[8..^1]} in {y} easy step{(y<2?"":"s")}!\n");i++<y;)Write($"\nStep {i} - {(i<y?$"Do not"+s:(char)(s[1]^32)+s[2..])}.");}

-1 byte thanks to Dominic van Essen

+13 bytes due to having to remove the "s" in steps if the random number = 1.

-2 bytes due to Julian

-2 bytes due to Neil

Try it online!

  • \$\begingroup\$ Your program needs to print two newlines after ...<n> easy steps!. \$\endgroup\$ – SunnyMoon Oct 15 '20 at 18:33
  • \$\begingroup\$ @SunnyMoon Fixed \$\endgroup\$ – Gymhgy Oct 15 '20 at 18:34
  • \$\begingroup\$ -1 byte by reversing ?: order: try it \$\endgroup\$ – Dominic van Essen Oct 15 '20 at 19:32
  • \$\begingroup\$ OP now requires removing "s" if n=1. \$\endgroup\$ – Adám Oct 15 '20 at 19:55
  • 1
    \$\begingroup\$ @Julian Coincidentally, I was experimenting with that concept earlier before I modified it from substrings and remove to ranges. Your comment just made me revisit it and save 2 bytes. Thanks! \$\endgroup\$ – Gymhgy Oct 16 '20 at 3:02

PowerShell Core, 188 bytes

$r=(Random 10)+1
"How to$q in $r easy step$(('s','')[$r-eq1])!`n"
1..$r|%{"Step $_ - "+("Do not$q.","$($q[1]|% t*g|% tou*t)$($q|% s*g 2).")[$_-eq$r]}

Line by line

  1. Isolates the task make coffee with the initial space
  2. Generates a random number in the range 1..10
  3. Prints the title with an extra new line and the conditional s
  4. Prints the steps
{"Step $_ - "
+("Do not$q.", # if it is not the last line
"$($q[1]|% t*g|% tou*t)$($q|% s*g 2))." # if if is the last line, first char uppercase and the rest of the string
)[$_-eq$r]} # "is it the last line" condition

Try it online!

  • \$\begingroup\$ nice. thanks. you can save some bytes. Try it online! \$\endgroup\$ – mazzy Oct 18 '20 at 8:05

CJam, 92 bytes

"How to "q9>);:Q" in "Amr):T" easy step"T1>'s*'!NT{"
Step "U)" - "T(U=!"do not "*Q+(eu\'.}fU

Try it online!


C (gcc), 194 193 192 190 189 bytes

Thanks to Petr Fiedler, Neil and ceilingcat for the suggestions.

By using the method in Petr Fiedler's answer, I don't have to use counted strings and store the first character. I've never used sscanf to create a copy of a string before, but it really works well. (Not needed here, but another neat thing about using the scanf family to get a string is that you can use the %n specifier to get the string length at the same time!)

i,j;f(char*s){sscanf(s,"%m[^?]",&s);for(printf("How to%s in %d easy step%s!\n",memcpy(s+=2,"Do not",6)+6,i=++j,"s"+!(j=time(0)%10));i--;printf("\nStep %d - %s.",j-i,(i||(*(s+=7)^=32),s)));}

Try it online!

Original method: 194 bytes

So that I don't have to copy the string to uppercase the first character, I grab the first character of the phrase and then adjust the start of the string to the character after that. I then print up to the character just before the question mark to complete the phrase.

i,j,l,c;f(char*s){for(c=*(s+=9),printf("How to %c%.*s in %d easy step%s!\n\n",c,l=strlen(++s)-1,s,i=++j,"s"+!(j=time(0)%10));i--;printf("Step %d - %s%c%.*s.\n",j-i,i?"Do not ":"",c-32*!i,l,s));}

Try it online!

  • \$\begingroup\$ You can save 1 byte by dropping the last space in "Do not ". You don't copy it anyway. \$\endgroup\$ – Petr Fiedler Oct 17 '20 at 2:59
  • \$\begingroup\$ You can save 2 bytes by printing a \n before Step, which avoids two of the other three uses. \$\endgroup\$ – Neil Oct 18 '20 at 19:14

Python 2, 157 bytes

print'How to %s in %d easy ste%s!\n'%(x,n,'ps'[:n])
exec"print'Step %d -'%i,('Do not %s.'%x)[i/n*7:].capitalize();i+=1;"*n

Try it online!

id(0)%19/2+1 is not uniform, but it has a nonzero chance of giving each number, unlike id(0)%10+1.


Perl 5 -n, 129 bytes

chop;/I /;say"How to $' in ",$b=0|1+rand 10," easy step",'s'x($b>1),"!
";say"Step $_ - ",ucfirst"Do not "x($b>$_).$',"."for 1..$b

Try it online!

  • 2
    \$\begingroup\$ The number of steps should be randomly generated by the program. \$\endgroup\$ – SunnyMoon Oct 15 '20 at 20:12
  • \$\begingroup\$ @SunnyMoon Changed to a random number of steps. \$\endgroup\$ – Xcali Oct 16 '20 at 5:00
  • \$\begingroup\$ 124 bytes \$\endgroup\$ – Nahuel Fouilleul Oct 16 '20 at 20:21

Charcoal, 89 85 82 80 bytes

≔✂S⁹±¹¦¹θ≔‽χηHow to θ in I⊕η easy step∧ηs¦!⸿F⊕η«⸿Step I⊕ι - ⭆⁺×Do not ‹ιηθ⎇λκ↥κ.

Try it online! Link is to verbose version of code. This feels far too long. Explanation:


Extract the verb from the input.


Get a random number from 0 to 9, which represents the number of "Do not"s.

How to θ in I⊕η easy step∧ηs¦!⸿

Print the header, but only output the s if the random number wasn't 0 (1 step).


Repeat for each step.

⸿Step I⊕ι - 

Start a new line and print the part common to each step. (For the first step this double-spaces the list of steps from the header.)

⭆⁺×Do not ‹ιηθ⎇λκ↥κ

Except for the last step, prefix Do not to the verb. Uppercase the first letter of the result.


Finish the step with a ..


Python 3, 160 170 168 167 bytes

s="Step %d - %%s."
p(f"How to {a} in {n} easy ste{'ps'[:n]}!\n")
for i in range(1,n):p(s%i%f"Do not {a}")

Try it online!

  • \$\begingroup\$ It seems my id()-based RNG only generates odd numbers (on cpython at least), too. I'm guessing that invalidates the solution. Are there any rules that the RNG has to be uniform? \$\endgroup\$ – Caagr98 Oct 15 '20 at 20:02
  • \$\begingroup\$ Because of memory alignment on most OSes, id(0)%10+1 will always be odd, but you can try something like id(0)%19/2+1. It's not uniform, but at least each number has a nonzero probability. \$\endgroup\$ – Sisyphus Oct 16 '20 at 1:56
  • \$\begingroup\$ This answer is invalid as written because "random" requires each value to have a non-zero probability of occuring, but @Sisyphus ' tweak would be valid with respect to the definition of "random" since uniformity is not required (per the same meta post). \$\endgroup\$ – pppery Oct 18 '20 at 19:15
  • \$\begingroup\$ However, even with Sisyphus' tweak, this answer is invalid as a non-reusable function, because if you give if the same string in the same execution it always produces the same output. This is inherent to id-based randomization, and the only fix I can think of is turning this answer into a full program instead of a function. \$\endgroup\$ – pppery Oct 18 '20 at 19:18
  • 1
    \$\begingroup\$ Turning it into a full program actually saved a couple of bytes. Seems not even id([]) works for randomness, probably because the GC makes it allocate the same memory each time. \$\endgroup\$ – Caagr98 Oct 18 '20 at 21:08

05AB1E, 74 bytes

TLΩÐD≠'s×sI8.$¨©“€ß€„ÿ€† ÿ‡šŠ¥ÿ!
“ˆG®N“Š¥ ÿ - Do€–ÿ.“ˆ}®™s“Š¥ ÿ -ÿ.“ˆ¯.ª»

Try it online.


TL                   # Push a list in the range [1,10]
  Ω                  # Pop and push a random value from this list
   ÐD                # Triplicate + Duplicate, so 4 copies are on the stack
     ≠               # Check if the top copy is NOT equal to 1 (0 if 1; 1 if [2,10])
      's×           '# Repeat "s" that many times
         s           # Swap so one random integer copy is at the top again
          I          # Push the input
           8.$       # Remove the first 8 characters ("How do I")
              ¨      # Remove the last character ("?")
               ©     # Store this verb in variable `®` (without popping)
“€ß€„ÿ€† ÿ‡šŠ¥ÿ!\n“  # Push dictionary string "how toÿ in ÿ easy stepÿ!\n",
                     # where the `ÿ` are filled with the top three values on the stack
                     # from left to right
                   ˆ # Pop and add this string to the global_array
G                    # Pop another random copy, and loop `N` in the range [1, n):
 ®                   #  Push the verb from variable `®`
  N                  #  Push `N`
   “Š¥ ÿ - Do€–ÿ.“   #  Push dictionary string "step ÿ - Do not ÿ.",
                     #  where the `ÿ` are filled with the top two values again
                  ˆ  #  Pop and add this string to the global_array
}                    # After the loop:
 ®                   # Push the verb again
  .ª                 # Sentence capitalize it
    s                # Swap so another random integer copy is at the top of the stack
     “Š¥ ÿ -ÿ.“      # Push dictionary string "step ÿ - ÿ.",
                     # where the `ÿ` are once again filled automatically
               ˆ     # Pop and push this string to the global_array as well
¯                    # Then push the global_array
 .ª                  # Sentence capitalize each string (without changing existing caps)
   »                 # And join this list by newlines
                     # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why “€ß€„ÿ€† ÿ‡šŠ¥ÿ!\n“ is "how toÿ in ÿ easy stepÿ!\n"; “Š¥ ÿ - Do€–ÿ.“ is "step ÿ - Do not ÿ."; and “Š¥ ÿ -ÿ.“ is "step ÿ - ÿ.".

  • \$\begingroup\$ Another stack based language beats the stack based language. Nice. \$\endgroup\$ – Razetime Oct 16 '20 at 10:09

Stax, 79 bytes


Run and debug it

Can probably be shortened by a lot. I'm not too familiar with string manipulation in stax yet.

Since stax does not have a random number function, this program uses the length of the string as n.


PowerShell Core, 163 161 bytes

-2 bytes thanks @Julian

$r=Random 10
"How to$q in $r easy step$s!
1..$r|%{"Step $_ -$(' do not'*($_-ne$r)+$q-replace'^ .',{"$_"|% tou*r})."}

Try it online!

  • 1
    \$\begingroup\$ Nice one! you can save 2 more bytes: by declaring $r first and doing $r++ without parenthesis: Try it online! \$\endgroup\$ – Julian Oct 19 '20 at 3:56
  • \$\begingroup\$ It's very smart! Thanks \$\endgroup\$ – mazzy Oct 19 '20 at 5:58

Japt -R, 79 bytes

A=ö)Îç¤i`How {=s8J}  {A±1} ey ¡ep` ·cAÆi`Do not` ·i¢iUÅÎu¹gAg°X)i`Sp {X} - 

Try it


Notepad++, 147 keystrokes

-(.+\r)<Tab>- Do not$1<Alt-A>

(Newlines inserted only for ease of reading.)


This solution requires version 7.9 of Notepad++ (at the time of writing, the most recent version), which added keyboard shortcuts to the Column Editor window.

The solution expects:

  • the question text to be in the buffer with the cursor at the end and no trailing newline;
  • the file to use Windows line endings;
  • the Replace dialog to have the following settings: Regular expression search ON, match whole word OFF, match case ON;
  • the Column Editor dialog to have the following settings: repeat BLANK, decimal format ON;
  • and the Go To dialog to be in Line mode.

I believe all of these restrictions can be worked around, at the cost of extra keystrokes.



Add a couple of newlines after the question text.


Insert an i on the bottom blank line, and then use CtrlDuplicate to make it 9 lines, each containing a single i.


Select those lines.


Open the Edit menu, go down to the Convert Case submenu, and select ranDOm CasE.

(As far as I know, this is the only source of randomness in Notepad++. I have no idea why it's even in there, but it's there, so we're gonna use it.)

We now have nine lines each containing either i or I at random.


Add a blank line at the end.


Find the first line that contains a lowercase i. If there is no lowercase i, the cursor stays on the blank line at the end.


Delete everything from there to the end of the file.

We now have the original question, a blank line, 0 to 9 lines of I, and another blank line.


Go to line 3 (the first I line).


Open the Column Editor dialog and insert a number at the beginning of each line from the cursor to the end of the file, starting at 1, with an increment of 1. The numbered lines will be every line with an I plus the blank line at the end. Thus, we end up inserting the numbers 1 to N, where N is a random number between 1 and 10.


Delete the I after each number.


Copy the last number (N).


Go to the end of the first line, delete the question mark, and insert the number plus the text easy steps!.


Position the cursor at the beginning of the first word after "How do I".


Select to the end of the line and copy (the action that I want to know how to do).




... each number X with Step X - [action]....

-(.+\r)<Tab>- Do not$1<Alt-A>

... the action on each instruction line except the last with Do not [action]...


... and 1 easy steps with 1 easy step.


Delete the newline between the action and N easy steps and replace it with in .


Change do to to and delete the I .


Go to the last line, select all but the first word, and convert to sentence case. This uppercases the first character of the action (e.g. Find a pen instead of find a pen).


Red, 180 bytes

func[s][t: n: 0
parse s["How do I "copy t to"?"]print["How to"t"in"n:
random 10"easy steps!^/"]append t"."repeat i
n - 1[print["Step"i"- Do not"t]]t/1:
t/1 - 32 print["Step"n"-"t]]

Try it online!


Pyth, 95 bytes

A,P>z9hOT%."\ny6¶†Õ8Âù<û¡*SŠÄ™‘uü'iyÃ",GHVtH%." t²aD–ñö«É ?6^ó",hNG;%." t8ݧGeµè‡",HrG4

Try it online!


A,                                                                                           # Set...
  P>z9                                                                                       # ...G to the verb...
      hOT                                                                                    # ...and H to the number of steps.
         %."\ny6¶†Õ8Âù<û¡*SŠÄ™‘uü'iyÃ",GH                                                    # Print "How to <G> in <H> easy steps!" with 2 trailing newlines.
                                              %." t²aD–ñö«É ?6^ó",hNG                        # Print "Step <N> - Do not <G>."...
                                           VtH                          ;                    # ...H-1 times.
                                                                         %." t8ݧGeµè‡",HrG4 # Print "Step <H> - <G>."

05AB1E, 99 90 bytes

-9 bytes by using (two-char string) and (three-char string).

ð¡3.$ðý¨U…€ß€„ .ªX«ð«„€† «TLΩ©«ð«„‡š›Ž«®i¨}…!

«®F„Š¥ ™«N>«… - «N>®QiX.ª«ë…€·€– .ª«X«}„.

Try it online!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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