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 4f081a4ef037090001000074

constructor

coding a constructor for a simple class

Start file
class SongEntry
{
public:
    SongEntry
        (
        QString mSinger = QString(),
        QString mSongName = QString(),
        QString mGender = QString(),
        QString mSongLang = QString(),
        int mSongLength = 0,
        QString mSongPath = QString(),
        QString mNotes = QString()
        );

private:
    int mId;
    QString mSinger;
    QString mSongName;
    QString mGender;
    QString mSongLang;
    int mSongLength; // in seconds
    QString mSongPath;
    QString mNotes;
};

===========================================================
End file
class SongEntry
{
public:
    SongEntry
        (
        QString mSinger = QString(),
        QString mSongName = QString(),
        QString mGender = QString(),
        QString mSongLang = QString(),
        int mSongLength = 0,
        QString mSongPath = QString(),
        QString mNotes = QString()
        );

private:
    int mId;
    QString mSinger;
    QString mSongName;
    QString mGender;
    QString mSongLang;
    int mSongLength; // in seconds
    QString mSongPath;
    QString mNotes;
};

===========================================================

SongEntry::SongEntry
    (
    QString aSinger,
    QString aSongName,
    QString aGender,
    QString aSongLang,
    int aSongLength,
    QString aSongPath,
    QString aNotes
    )
    : mSinger( aSinger )
    , mSongName( aSongName )
    , mGender( aGender )
    , mSongLang( aSongLang )
    , mSongLength( aSongLength )
    , mSongPath( aSongPath )
    , mNotes( aNotes )
{
}

View Diff

26a27,46
> 
> SongEntry::SongEntry
>     (
>     QString aSinger,
>     QString aSongName,
>     QString aGender,
>     QString aSongLang,
>     int aSongLength,
>     QString aSongPath,
>     QString aNotes
>     )
>     : mSinger( aSinger )
>     , mSongName( aSongName )
>     , mGender( aGender )
>     , mSongLang( aSongLang )
>     , mSongLength( aSongLength )
>     , mSongPath( aSongPath )
>     , mNotes( aNotes )
> {
> }

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 54 remaining solutions by signing in and submitting your own entry
#55 無ん垢の叫び / @john_ababa - Score: 392 - 02/29/12 @ 08:21
Go<Esc>:a!<CR>SongEntry::SongEntry<CR>    (<CR>    QString aSinger,<CR>    QString aSongName,<CR>    QString aGender,<CR>    QString aSongLang,<CR>    int aSongLength,<CR>    QString aSongPath,<CR>    QString aNotes<CR>    )<CR>    : mSinger( aSinger )<CR>    , mSongName( aSongName )<CR>    , mGender( aGender )<CR>    , mSongLang( aSongLang )<CR>    , mSongLength( aSongLength )<CR>    , mSongPath( aSongPath )<CR>    , mNotes( aNotes )<CR>{<CR>}<CR><Esc><Esc>ZZ

0 comments


Created by: @Arton0306

55 active golfers, 162 entries

Leaderboard (lowest score wins):
100
#31 - Song Zheng / @songz

01/26/2012 at 12:19PM

100
#32 - Øystein Walle / @oysteinwalle

05/31/2012 at 07:33PM

101
#33 - Christopher Brew / @Seph1rothVII

01/23/2012 at 11:55PM

107
#34 - Calvin Condon / @ccondon

01/30/2012 at 05:13AM

107
#35 - Mislav Marohnić / @mislav

03/19/2012 at 12:30PM

108
#36 - Radek / @qrczeno

04/19/2012 at 06:39PM

108
#37 - Ilya Ermolin / @ermolinis

06/25/2012 at 04:04PM

110
#38 - Martin Delille / @martinodelilo

09/01/2019 at 03:44PM

114
#39 - pangloss / @tpattern

01/31/2012 at 07:11AM

115
#40 - Maciej Suchecki / @mcSuchecki

01/07/2012 at 12:22PM

124
#41 - Kurt Gaastra / @KGaastra

02/10/2012 at 10:21PM

125
#42 - Tibor Claassen / @codebeige

05/01/2012 at 09:31PM

126
#43 - artanis / @artanislives

01/30/2012 at 05:07PM

126
#44 - Glen / @Glen_S

07/21/2012 at 08:58PM

127
#45 - Dan Huang / @yuzeh

02/16/2012 at 07:21AM

139
#46 - Ben Friedland / @bfriedland174

05/21/2012 at 05:47AM

143
#47 - not so punk :] / @notsopunk

03/31/2012 at 04:36AM

144
#48 - neerajsharma / @neerajsharma

01/25/2012 at 10:04AM

171
#49 - Thijs Brobbel / @tiesmaster

02/03/2012 at 03:22PM

175
#50 - J. / @jdot

02/15/2012 at 07:49PM

202
#51 - Forrest L Norvell / @othiym23

01/27/2012 at 11:00AM

209
#52 - Luke Zulauf / @azound

01/31/2012 at 07:49PM

210
#53 - Markus / @markus1189

04/19/2012 at 01:17PM

221
#54 - Philippe Mongeau / @phmongeau

01/19/2012 at 02:58AM

392
#55 - 無ん垢の叫び / @john_ababa

02/29/2012 at 08:21AM