| Bytes | Lang | Time | Link |
|---|---|---|---|
| 014 | Japt R | 170815T090104Z | Shaggy |
| 039 | Perl 5 | 170908T222920Z | Xcali |
| 045 | Perl 5 | 170823T183005Z | Massa |
| 061 | Python 3 | 170815T213744Z | Conner J |
| 074 | C gcc | 170815T180147Z | cleblanc |
| 016 | Japt | 170815T130412Z | ETHprodu |
| 029 | Pyth | 170815T174835Z | ajc2000 |
| 027 | Retina | 170815T133004Z | Neil |
| 033 | Pyth | 170815T112016Z | Karan El |
| 015 | Husk | 170815T110008Z | H.PWiz |
| 017 | Jelly | 170815T102359Z | Erik the |
| 052 | Python 2 | 170815T084111Z | Arfie |
| 016 | 05AB1E | 170815T090148Z | Emigna |
| 013 | Charcoal | 170815T091032Z | Neil |
| 037 | Python 2 | 170815T084710Z | xnor |
| nan | 170815T084924Z | colsw | |
| 132 | C# Mono | 170815T085154Z | TheLetha |
| 015 | SOGL V0.12 | 170815T083950Z | dzaima |
| 053 | Ruby | 170815T083233Z | AJFarada |
Japt -R, 20 18 14 bytes
21Æ`¬v`úX+7"ef
21Æ`¬v`úX+7"ef
21Æ :Map each X in the range [0,21)
`¬v` : Compressed string "cov"
ú : Pad left
X+7 : To length X+7
"ef : With "ef"
:Implicit output joined with newlines
Python 3, 61 bytes
def f(n=20):
print(' '*n+('covf'+'ef'*12)[:~n])
if n:f(n-1)
not the shortest, but prints triangle without e/f vertical adjacency
C (gcc), 77 75 74 bytes
f(i,j){for(i=4;i++<25;)for(printf("\ncov"),j=i;--j;)putchar("ef"[i-j&1]);}
Japt, 17 16 bytes
4o25_îeif)i`¬v
Test it online! 14 bytes of code, +2 for -R flag. If we can output as an array, simply remove the -R and subtract 2 bytes.
Explanation
4o25 Generate the range [4, 5, ..., 24].
_ Map each item in this range to
eif "fe" (really weird hack, but it works and saves a byte)
î ) repeated to length <item>
i`¬v with "cov" inserted at the beginning.
Implicit: output result of last expression, joined with newlines (-R)
Alternatively, you could do 7o28_îfie)h"cov, which does the same thing, except overwriting cov onto the beginning of the string instead of inserting it at the beginning.
Pyth, 29 bytes
Vr4 25+"cov"+*/N2"fe"?%N2"f"k
Explanation:
Vr 4 25 Loops variable N from 4 to 24 (excludes 25)
*/N2"fe" Repeats string "fe" N / 2 number of times
?%N2"f"k Concatenates "f" if N % 2 is 1 (odd), or an empty
string if it is even (N % 2 is 0)
+ Concatenates strings
Retina, 27 bytes
covf12$*
1
ef
.
$`¶
G`.{7}
Try it online! Explanation:
covf12$*
Add covf plus 12 1s.
1
ef
Change each 1 to ef. This results in the last line of the desired output, but with an extra f.
.
$`¶
Replace the string with a list of all of its proper prefixes.
G`.{7}
Delete the prefixes that are too short.
05AB1E, 17 16 bytes
„fe12×禦¦…covì»
Explanation
„fe # push the string "fe"
12× # repeat it 12 times
η # get the prefixes of this string
¦¦¦ # drop the first 3
…covì # prepend the string "cov" to each
» # join on newline
Charcoal, 13 bytes
E²¹⁺cov…fe⁺⁴ι
Try it online! Link is to verbose version of code. Explanation:
Implicitly print joined with newlines
E²¹ the implicit range 0..21 mapped to
⁺cov the concatenation of "cov" with
…fe the characters "fe" repeated until their length is exactly
⁺⁴ι 4 more than the value
Python 2, 37 bytes
s='covfef'
exec"s+=s[-2];print s;"*21
Matches the text shown.
Python 2, 36 bytes
s='covfefe'
exec"print s;s+='?';"*21
Prints:
covfefe
covfefe?
covfefe??
covfefe???
covfefe????
covfefe?????
covfefe??????
covfefe???????
covfefe????????
covfefe?????????
covfefe??????????
covfefe???????????
covfefe????????????
covfefe?????????????
covfefe??????????????
covfefe???????????????
covfefe????????????????
covfefe?????????????????
covfefe??????????????????
covfefe???????????????????
covfefe????????????????????
Totally valid answer which matches the specs/rules.
PowerShell, 25 Bytes. Try it online!
"covfefe";8..28|%{'?'*$_}
OR (same byte count)
0..21|%{'covfefe'+'?'*$_}
As intended answer which matches the example output.
PowerShell, 44 Bytes. Try it online!
$c="covfef";0..20|%{($c=$c+('e','f')[$_%2])}
Ugly assignment at the beginning, i'm sure there's some that can be saved here.
C# (Mono), 132 bytes
using System.Linq;_=>{for(int i=0;i<21;)System.Console.WriteLine("cov"+string.Concat(new int[4+i++].Select((n,j)=>j%2<1?"f":"e")));}
SOGL V0.12, 16 15 bytes
4'⁷Ν{ņcoļvƧfemo
Explanation:
4'⁷Ν push inclusive range from 4 to 24
{ for each do
ņcoļv output in a new line "cov" (split into 2 commands of "output 2 chars in a new line" and "output next char" for a byte save)
Ƨfemo output "fe" molded into the length of the current item
Ruby - 53 chars
s='covfef';21.times{|i|puts s +=(i.odd? ? 'f' : 'e')}
Note: This is the OP's answer, there must be better one's out there.