Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package cmd
import (
"fmt"
"log"
"math/rand"
"os"
"path/filepath"
"time"

"github.com/codegangsta/cli"
"github.com/exercism/cli/api"
Expand Down Expand Up @@ -96,38 +94,5 @@ func Submit(ctx *cli.Context) {
log.Fatal(err)
}

msg := `
Submitted %s in %s.
Your submission can be found online at %s
`

if submission.Iteration == 1 {
msg += `
To get the next exercise, run "exercism fetch" again.
`
rand.Seed(time.Now().UTC().UnixNano())
phrases := []string{
"For bonus points",
"Don't stop now: The fun's just begun",
"Some tips to continue",
}
msg += fmt.Sprintf("\n## %s\n", phrases[rand.Intn(len(phrases))])
msg += tips
}

fmt.Printf(msg, submission.Name, submission.Language, submission.URL)
fmt.Printf("%s - %s\n%s\n\n", submission.Language, submission.Name, submission.URL)
}

const tips = `
Did you get the tests passing and the code clean? If you want to, these are some
additional things you could try:

* Remove as much duplication as you possibly can.
* Optimize for readability, even if it means introducing duplication.
* If you've removed all the duplication, do you have a lot of conditionals? Try
finding ways to reduce or remove them. How does this affect your code's
readability? Its performance?

Then please share your thoughts in a comment on the submission. Did this
experiment make the code better? Worse? Did you learn anything from it?
`