Go translation
True, changed that & also made test headers more useful.
Oops 🤦 Added self_init call and random non-palindromes.
self_init
It isn't best practice, but because they are passing the literal 0.0. Instead, 0 would work just as well. (Go literals are untyped.)
0.0
0
Re: The Go translation
The function's return type should have been [][2]string, to match other languages.
[][2]string
OCaml translation
Added random tests
Added random test
Same thing here, just ported the JS tests and there weren't random ones. But if it's ok to add additional tests to a translation, I will.
Good point, added a call
I ported this from JavaScript, which has no random tests. Is it ok to add additional tests to a translation?
Agreed. Also, in Go a return type of (int, int) would be more idiomatic than [2]int (although more cumbersome to test)
(int, int)
[2]int
Loading collection data...
Go translation
True, changed that & also made test headers more useful.
Oops 🤦
Added
self_init
call and random non-palindromes.It isn't best practice, but because they are passing the literal
0.0
. Instead,0
would work just as well. (Go literals are untyped.)Re: The Go translation
The function's return type should have been
[][2]string
, to match other languages.OCaml translation
Added random tests
Added random test
Same thing here, just ported the JS tests and there weren't random ones.
But if it's ok to add additional tests to a translation, I will.
Good point, added a call
I ported this from JavaScript, which has no random tests.
Is it ok to add additional tests to a translation?
Agreed. Also, in Go a return type of
(int, int)
would be more idiomatic than[2]int
(although more cumbersome to test)Go translation
Go translation
Go translation
Loading more items...