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.
Unlock 140 remaining solutions by signing in and submitting your own entry
#141 Taras Parshenko / @Timestreched - Score: 151 - 04/30/12 @ 20: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