Compile C
You might have to get clever to do this one.
Start file
int main()
{
char *s = "Hello, world!";
int i, j;
for (i = 0; s[i]; i++) {
for (j = 0; j <= i; j++)
putchar(s[j]);
putchar('\n');
}
return 0;
}
End file
H He Hel Hell Hello Hello, Hello, Hello, w Hello, wo Hello, wor Hello, worl Hello, world Hello, world!
View Diff
1,13c1,13
< int main()
< {
< char *s = "Hello, world!";
< int i, j;
<
< for (i = 0; s[i]; i++) {
< for (j = 0; j <= i; j++)
< putchar(s[j]);
< putchar('\n');
< }
<
< return 0;
< }
---
> H
> He
> Hel
> Hell
> Hello
> Hello,
> Hello,
> Hello, w
> Hello, wo
> Hello, wor
> Hello, worl
> Hello, world
> Hello, world!
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
#109 Jordan Lewis / @JordanALewis - Score: 22 - 12/30/10 @ 10:29
d/H<CR>f"vGxqqYP$xq11@qZZ
0 comments
#110 Rob Hanlon / @ohwillie - Score: 22 - 12/30/10 @ 19:55
:!cc %;./a.out>%<CR><CR>:wq<CR>
0 comments
#117 Tyler Breisacher / @tbreisacher - Score: 24 - 08/25/12 @ 02:14
d/H<CR>jdG$xxqqyyP$xq11@qZZ
0 comments
#118 Francisco Dibar / @frandibar - Score: 25 - 01/12/11 @ 19:49
9wyi":%d<CR>"0pqqYp<BS>xq11@qZZ
0 comments
#121 Matthew Kirk / @mjkirk - Score: 27 - 01/01/11 @ 23:36
:!cc %<CR><CR>dG:r!./a.out<CR>ggddZZ
0 comments
#123 Marc Simonin / @TheGnorf - Score: 29 - 12/31/10 @ 07:53
:!gcc %<CR><CR>vGd:r!./a.out<CR>ggddZZ
0 comments
#124 bestform / @bestform - Score: 29 - 02/05/11 @ 13:35
cGHello, world!<Esc>qaYP$xq11@aZZ
0 comments
#125 Ashley Feniello / @AshleyFen - Score: 29 - 01/28/12 @ 22:56
d/H<NL>f"3d}yy12pk qqDj q12@qZZ
0 comments
#126 Siegfried Idyll / @siegfriedidyll - Score: 30 - 07/04/11 @ 12:09
djjdGd4wxXXXf"DqaYP$xq13@adjZZ
0 comments
#127 ümit kablan / @udslk - Score: 30 - 03/10/12 @ 03:14
G:!cc %<CR><CR>:r!./a.out<CR>13Gdgg:wq<CR>
0 comments
#128 Julien Pivotto / @roidelapluie - Score: 31 - 03/17/11 @ 14:15
dGiHello, world!<Esc>qqyyP$xq11@qZZ
0 comments
#129 Gary Rennie / @TheGazler - Score: 31 - 08/01/12 @ 12:28
VGcHello, world!<Esc>qayyP$xq11@aZZ
0 comments
#130 Guillaume Bonnoron / @gbonnoron - Score: 32 - 12/30/10 @ 07:22
13ccHello, world!<Esc>qqyyP$xq11@qZZ
0 comments
#131 Sébastien Quioc / @SQuiOc - Score: 32 - 12/30/10 @ 07:35
:!gcc %<CR><CR>:%d<CR>:r !./a.out<CR>:0d<CR>:x<CR>
0 comments
#132 Arto Vuori / @dhpe - Score: 33 - 09/01/12 @ 12:11
/H<CR>dt"ggPlDY12pklqqDjllq12@qjdGZZ
0 comments
#133 Yannick LM / @yanicklm - Score: 35 - 12/30/10 @ 08:30
:!cc % -o a<CR><CR>VGd0:0r!./a<CR>kjjdd<Esc>:wq<CR>
0 comments
#134 ovo / @prokrastinatsia - Score: 37 - 08/11/12 @ 18:05
9wcf"Vp<Esc>uuugg9wcf"Vp$xYk<Esc>G13@.u<C-U>g+:x<CR>
0 comments
#135 Taras Parshenko / @Timestreched - Score: 151 - 04/30/12 @ 13:43
9dw3wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<Left><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Left>47dwuu9dw3w49dwu48dwu47dwul47dwu48dw^qayyi<CR><Esc><Up>uqqayyp<Up>$x^q@au11@a:wq!<CR>
0 comments
VimGolf