Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 9v0064f211df000000000255

Remove line numbers

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

Start file
   1    #include<stdio.h>
   2    static void display(int i, int *ptr);
   3    
   4    int main(void) {
   5       int x = 5;
   6       int *xptr = &x;
   7       printf("In main():\n");
   8       printf("   x is %d and is stored at %p.\n", x, &x);
   9       printf("   xptr points to %p which holds %d.\n", xptr, *xptr);
   10      display(x, xptr);
   11      return 0;
   12   }
   13   
   14    void display(int z, int *zptr) {
   15    	printf("In display():\n");
   16       printf("   z is %d and is stored at %p.\n", z, &z);
   17       printf("   zptr points to %p which holds %d.\n", zptr, *zptr);
   18   }
End file
#include<stdio.h>
static void display(int i, int *ptr);
       
int main(void) {
	int x = 5;
	int *xptr = &x;
	printf("In main():\n");
	printf("   x is %d and is stored at %p.\n", x, &x);
	printf("   xptr points to %p which holds %d.\n", xptr, *xptr);
	display(x, xptr);
	return 0;
}

void display(int z, int *zptr) {
	printf("In display():\n");
	printf("   z is %d and is stored at %p.\n", z, &z);
	printf("   zptr points to %p which holds %d.\n", zptr, *zptr);
}

View Diff

1,18c1,18
<    1    #include<stdio.h>
<    2    static void display(int i, int *ptr);
<    3    
<    4    int main(void) {
<    5       int x = 5;
<    6       int *xptr = &x;
<    7       printf("In main():\n");
<    8       printf("   x is %d and is stored at %p.\n", x, &x);
<    9       printf("   xptr points to %p which holds %d.\n", xptr, *xptr);
<    10      display(x, xptr);
<    11      return 0;
<    12   }
<    13   
<    14    void display(int z, int *zptr) {
<    15    	printf("In display():\n");
<    16       printf("   z is %d and is stored at %p.\n", z, &z);
<    17       printf("   zptr points to %p which holds %d.\n", zptr, *zptr);
<    18   }
---
> #include<stdio.h>
> static void display(int i, int *ptr);
>        
> int main(void) {
> 	int x = 5;
> 	int *xptr = &x;
> 	printf("In main():\n");
> 	printf("   x is %d and is stored at %p.\n", x, &x);
> 	printf("   xptr points to %p which holds %d.\n", xptr, *xptr);
> 	display(x, xptr);
> 	return 0;
> }
> 
> void display(int z, int *zptr) {
> 	printf("In display():\n");
> 	printf("   z is %d and is stored at %p.\n", z, &z);
> 	printf("   zptr points to %p which holds %d.\n", zptr, *zptr);
> }

Solutions by @poeminlash:

Unlock 15 remaining solutions by signing in and submitting your own entry
Created by: @FnMailbox

148 active golfers, 551 entries

Solutions by @poeminlash:
12
#37 - Qing Liu / @poeminlash

12/14/2023 at 03:48AM

12
#>37 - Qing Liu / @poeminlash

12/14/2023 at 03:52AM

13
#>70 - Qing Liu / @poeminlash

12/14/2023 at 03:48AM

15
#>87 - Qing Liu / @poeminlash

12/14/2023 at 03:47AM

20
#>95 - Qing Liu / @poeminlash

12/14/2023 at 03:35AM

21
#>97 - Qing Liu / @poeminlash

12/14/2023 at 03:32AM

23
#>101 - Qing Liu / @poeminlash

12/14/2023 at 03:32AM

26
#>105 - Qing Liu / @poeminlash

12/14/2023 at 03:31AM

28
#>107 - Qing Liu / @poeminlash

12/14/2023 at 03:28AM

30
#>109 - Qing Liu / @poeminlash

12/14/2023 at 03:28AM

33
#>115 - Qing Liu / @poeminlash

12/14/2023 at 03:27AM

34
#>117 - Qing Liu / @poeminlash

12/14/2023 at 03:27AM

35
#>120 - Qing Liu / @poeminlash

12/14/2023 at 03:26AM

38
#>124 - Qing Liu / @poeminlash

12/14/2023 at 03:25AM

44
#>129 - Qing Liu / @poeminlash

12/14/2023 at 03:23AM