Created
March 11, 2021 02:11
-
-
Save emmettna/fe9fdaf5dd68d1de1cc0a3ac2cdeacc0 to your computer and use it in GitHub Desktop.
calculate cell numbers hidden behind a spear line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// porivided width * height | |
// calculate the number of empty cells | |
// ex) [ ][ ][/] | |
// [ ][/][ ] | |
//. [/][ ][ ] | |
// | |
// gcd : https://gist.github.com/emmettna/702d972126d381dcceb8d8122ba7893c | |
def calcEmptyCells(width: Int, heght: Int): Int = width + heght - (gcd(width, heght)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment