How would you modify this version of wordcount for So ? #12
serge-hulne
started this conversation in
General
Replies: 4 comments 2 replies
|
Thanks! |
0 replies
|
Here is my attempt to rewrite Wordcount in So: |
0 replies
|
Very nice, thank you! Just a small note — you can use a regular type assertion instead of func wordCountCmp(a, b any) int {
va := a.(*WordCount)
vb := b.(*WordCount)
if va.count > vb.count {
return -1
}
if va.count < vb.count {
return 1
}
return 0
} |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I suppose you just would have to implement a scanner and a sort routine (quicksort?).
All reactions