-3
\$\begingroup\$

The challenge today is to write a program that outputs a known proverb, Where there is a will, there is a way., that means if someone is determined to do something, he will find a way to accomplish it regardless of obstacles.

Output

It has to be exactly the same, including the space bar and punctuation and excluding the newline at the end.

Where there is a will, there is a way.

You may not use Where there is a will or way anywhere in the source.

This is , shortest answer per language wins.

\$\endgroup\$
10
  • \$\begingroup\$ Looks like specific question titles can cause CAPTCHA popups. \$\endgroup\$ Commented Apr 11, 2020 at 12:43
  • \$\begingroup\$ @Deusovi Should I use the rosetta-stone tag? \$\endgroup\$ Commented Apr 11, 2020 at 12:46
  • 3
    \$\begingroup\$ Welcome to Code Golf! Let's put aside for a moment the fact that this is probably a dupe. Can you confirm that there must be no "a" at all in the source code, since this is a single-character forbidden string? \$\endgroup\$
    – Arnauld
    Commented Apr 11, 2020 at 13:04
  • 4
    \$\begingroup\$ We've had a lot of challenges before about printing strings without using them or parts of them, and I think the methods for doing this have been pretty thoroughly mined out. Not something I'd expect a new poster to know, of course. \$\endgroup\$
    – xnor
    Commented Apr 11, 2020 at 13:05
  • 1
    \$\begingroup\$ I've rephrased the challenge so it's simpler to understand and shows more effort put into making it. \$\endgroup\$ Commented Apr 12, 2020 at 12:04

15 Answers 15

5
\$\begingroup\$

05AB1E, 23 bytes

-2 thanks to @Kevin Cruijssen

…€Ç€ˆ€…“‚à ÿ€§, ÿƒƒ.“.ª

Try it online!

Older version, 24 bytes

“‚Àǀˆ€…€§,€Ç€ˆ€…ƒƒ.“.ª

-1 thanks to @petStorm

Try it online!

\$\endgroup\$
7
  • \$\begingroup\$ You posted exactly when I finished my own 05AB1E solution... it's shorter anyway. \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 13:59
  • \$\begingroup\$ Sentence capitalization is a built-in. \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 14:03
  • \$\begingroup\$ I tried it, I wonder why it didn't work... \$\endgroup\$ Commented Apr 11, 2020 at 14:04
  • \$\begingroup\$ Here's mine. \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 14:11
  • \$\begingroup\$ Do you have any idea why this doesn't capitalize correctly? \$\endgroup\$ Commented Apr 11, 2020 at 14:59
4
\$\begingroup\$

JavaScript (ES6), 50 bytes

_=>`W\here${s=' t\here i\s \x61 w'}ill,${s}\x61y.`

Try it online!

\$\endgroup\$
4
\$\begingroup\$

Retina 0.8.2, 38 bytes


Wht8ll,t0y.
t
 th 8s 0 w
h
here
T`d`l

Try it online! Explanation:


Wht8ll,t0y.

Insert Wht1ll,t0y..

t
 th 8s 0 w

Expand to Wh th 8s 0 w8ll, th 8s 0 w0y..

h
here

Expand to Where there 8s 0 w8ll, there 8s 0 w0y..

T`d`l

Transliterate the digits to letters, so as to avoid having the words is or a in the code.

\$\endgroup\$
1
  • \$\begingroup\$ @Leo's Retina Kolmogorov golfer came up with a similar solution that is also 38 bytes. \$\endgroup\$
    – Neil
    Commented Dec 27, 2020 at 18:06
3
\$\begingroup\$

C (gcc), 87 78 75 ... 59 bytes

-9 bytes thanks to @my pronoun is monicareinstate!

-3 bytes thanks to @Arnauld!

+1 byte for forgetting the period

-3 bytes thanks to @petStorm!

-3 bytes thanks to @ceilingcat!

f(){printf("W\here%sill,%1$s\x61y."," t\here i\s \x61 w");}

Try it online!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ 77 and valid: Try it online! \$\endgroup\$ Commented Apr 11, 2020 at 13:03
  • 1
    \$\begingroup\$ 74 bytes \$\endgroup\$
    – Arnauld
    Commented Apr 11, 2020 at 13:15
  • 2
    \$\begingroup\$ You can abuse some undefined escape codes (stolen from Arnauld's answer). 64 bytes \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 14:30
3
+100
\$\begingroup\$

APL (Dyalog Unicode), 102 bytes

x←⎕UCS 97
⎕←('⎕'⎕R'')'Wher⎕e ther⎕e i⎕s ',x,' w⎕ill, t⎕here i⎕s ',x,' w⎕ay.'

Try it online!

Explanation:

x←⎕UCS 97

Define x and store ASCII (⎕UCS) 97

⎕←

Print (not be confused with define ⎕)

('⎕'⎕R'')

⎕Replace '⎕' to empty string

'Wher⎕e ther⎕e i⎕s ',x,' w⎕ill, t⎕here i⎕s ',x,' w⎕ay.'

will be

'Where there is ',x,' will, there is ',x,' way.'

And

...',x,'...

Means Followed by "a" followed by other string

Or if you want everything in one code then

x←⎕UCS 97     x = "a"
⎕←('⎕'⎕R'')'Wher⎕e ther⎕e i⎕s ',x,' w⎕ill, t⎕here i⎕s ',x,' w⎕ay.'
⎕←                                                                        Print
                                                                 ' w⎕ay.' The string 'w⎕ay.'
                                                                ,          Join
                                                               x           "a"
                                                              ,            Join
                                      ' w⎕ill, t⎕here i⎕s '              The string ' w⎕ill, t⎕here i⎕s '
                                   ,x,                                     Join, "a", Join
            'Wher⎕e ther⎕e i⎕s '                                         The string 'Wher⎕e ther⎕e i⎕s '
  ('⎕'⎕R'')                                                               Replace '⎕' to Empty String
\$\endgroup\$
1
  • 3
    \$\begingroup\$ 44 bytes: ⍞←'W',⎕C'_'⎕R' THERE IS A W'⊢'HERE_ILL,_AY.' \$\endgroup\$
    – Adám
    Commented Jan 5, 2022 at 16:43
2
\$\begingroup\$

Bash + Core utilities, 54 52 51 50 bytes

echo WHERE "THERE IS A w"{ILL\,,Ay}|tr ?-V\\n _-v.

Try it online!



If we're allowed to print a newline at the end, as several other entries appear to be doing, then:

Bash + Core utilities, 47 bytes

echo WHERE "THERE IS A w"{ILL\,,Ay.}|tr ?-V _-v

Try it online!

\$\endgroup\$
0
2
\$\begingroup\$

Brain-Flak, 1170 bytes (by hand)

I wrote this one by averaging the ascii value of every character in the saying. I then pushed the value (87) to the stack. Then on stack 2 I pushed the ascii value of the next character - 87 then added 87. The numbers were all coded by this program

((((((()()()){}()){}){}())){}{})<>([(((()()()()()){}){}){}()])((((()()()()){}){}()){}<>({})<>)((()()()()()){}<>({})<>)((((()()()()){}){}){}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)((()()()()()){}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)((((()()()){}()){}){}<>({})<>)((((()()()){})){}{}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)(((()()()){}()){}<>({})<>)(((((()()())){}{})){}{}<>({})<>)(((()()()){}()){}<>({})<>)(((()()()()){}){}()<>({})<>)((((()()()){}()){}){}()<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)([((((()()()){}()){})){}{}()]<>({})<>)((((()()()){}())){}{}<>({})<>)((((()()()){}())){}{}<>({})<>)((((()()()){})){}{}<>({})<>)((((()()()()){}){}){}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)((()()()()()){}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)((((()()()){}()){}){}<>({})<>)((((()()()){})){}{}<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)(((()()()){}()){}<>({})<>)(((((()()())){}{})){}{}<>({})<>)(((()()()){}()){}<>({})<>)(((()()()()){}){}()<>({})<>)((((()()()){}()){}){}()<>({})<>)([((()()()()()){}){({}[()])}{}]<>({})<>)((((()()()){}())()){}{}<>({})<>)(((()()()){}()){}<>({})<>)(((()()()()){}){}()<>({})<>)(<>{}<>)

Try it online!

Brain-Flak, 640 bytes (using text generator found here)

This was produced using an answer to a challenge I maded a while back.

(((((<(((<(<((<<((((<(<((((((((<(<(((((()(()(()()()()()){}){}){})(()(((()()[]){}){}){})({}){})[(((()[]){}){}){}])(()(()()[]){}){})>(((([]){}){}){})()((()([])({}){}){}){})>(((()()[]){}){})()(()((()()()[]){}){}){})[()()[]])[()((([]){}){}){}])(()(()[]){})({}){})()()[])[()[]])()()())((()()()){}){})>((()[]){})((()()()){}){})>(((()[])({}){}){}))[()()()])(()(()()()){}){})[()(()([]){}){}])>(()((()()[]){}){})>(()()()()()()()()()[])()()(()()()[])({}){})[(()()()()()){}])>(()()()()()()[])()(()()()()()()()[]){})>((()([]){}){})[()((()()()){}){}])()()())((()()()){}){})>([])()(()[]){})()((()()()){}){})[()((()()()){}){}])()()())[()((()()()()){}){}])

Try it online!

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

Python 3, 95 60 59 bytes

exit("W""here%sill,%s\x61y."%((" t""here i""s \x61 w",)*2))

Try it online!

-35 bytes thanks to newbie and petStorm. -1 byte thanks to newbie and petStorm.

I completely forgot that % did string formatting.

\$\endgroup\$
7
  • \$\begingroup\$ porting my C answer, 60 bytes \$\endgroup\$
    – newbie
    Commented Apr 11, 2020 at 14:43
  • \$\begingroup\$ Python has string formatting as well. Same length, 60 bytes \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 14:46
  • \$\begingroup\$ On Python 3.8 you can save a single byte using the walrus operator. 59 bytes \$\endgroup\$
    – user92069
    Commented Apr 11, 2020 at 14:47
  • \$\begingroup\$ Aww, I completely forgot % did formatting \$\endgroup\$ Commented Apr 11, 2020 at 14:51
  • \$\begingroup\$ No need for walrus operator tho. 59 bytes, python 2 \$\endgroup\$
    – newbie
    Commented Apr 11, 2020 at 14:52
1
\$\begingroup\$

brainfuck, 241 bytes

++++++++++[>+++++++++>++++++++++>++++++++++>+++++++++++>++++>+++<<<<<<-]>---.>++++.>+.>++++.<.>>>++.<<++.<<.>.>--.<.>>>.<<<<+.>>+.>>.<<<----.>>>.<<++++.<<.+++..>>>++++.>.<<---.<<----.>++++.>--.<.>>>.<<<<+.>>+.>>.<<<----.>>>.<<++++.<.>++.>++.

Try it online!

Could use some golfing but it's getting late.

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

Erlang (escript), 65 bytes

z()->"W\here"++[" t\here i\x73 \x61 w"++X||X<-["ill,","\x61y."]].

Try it online!

Erlang (escript), 65 bytes

This simply employs the almighty hard-coding.

z()->"W\here t\here i\x73 \x61 w\ill, t\here i\x73 \x61 w\x61y.".

Try it online!

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

V (vim), 44 bytes

iWh t wi²l, t w97y.Ót/&h i115 97
Óh/here

Try it online!

Hexdump:

00000000: 6957 6820 7420 7769 b26c 2c20 7420 7716  iWh t wi.l, t w.
00000010: 3937 792e 1bd3 742f 2668 2069 1631 3135  97y...t/&h i.115
00000020: 2016 3937 0dd3 682f 6865 7265             .97..h/here

I suspect this can be shorter, but I'm a bit rusty with V.


Yes it can be shorter!

V (vim), 42 bytes

i.yaw 97 si ereht ,lliw 97 si e erehWæ

Try it online!

Hexdump:

00000000: 692e 7961 7720 1639 3720 7369 2065 7265  i.yaw .97 si ere
00000010: 6874 202c 6c6c 6977 2016 3937 2073 6920  ht ,lliw .97 si 
00000020: 650e 2065 7265 6857 1be6                 e. erehW..

V or vim, either one, 38 bytes

iwHERE THERES A WILL, THERES A WAY.V~

Try it online!

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

Deadfish~, 341 bytes

{{i}d}dddc{i}{i}dddcdddc{i}iiic{d}dddc{{d}iii}ic{{i}dd}iiiic{d}ddcdddc{i}iiic{d}dddc{{d}iii}ic{{i}ddd}iiic{i}c{{d}ii}dddc{{i}dddd}iiiiic{{d}iiii}dddddc{{i}d}dddc{d}ddddciiicc{{d}iiii}ddddc{d}ddc{{i}dd}iiiic{d}ddcdddc{i}iiic{d}dddc{{d}iii}ic{{i}ddd}iiic{i}c{{d}ii}dddc{{i}dddd}iiiiic{{d}iiii}dddddc{{i}d}dddc{d}{d}ddc{i}{i}iiiic{{d}iii}dddddc

Try it online!

Not as bad as usual!

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

Japt -S, 26 bytes

`ï,ÀnØi,ÌÀÎsn°y.`qn

Test it

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

Jelly, 25 bytes

“ḅṫ!Ḃḃ0ʋŀɼYẆḊỵ2Ƭqɦ⁷-&Y£z»

Try it online!

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

Stax, 13 bytes

üx♦r i0c@9lc¡

Run and debug it

\$\endgroup\$

Your Answer

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

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