-
-
Save johansjoberg/1572791 to your computer and use it in GitHub Desktop.
Testing... tailrec optimization with annotation
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
@tailrec | |
def tileSizeCalc(f: Int): Int = { | |
val tileSize = math.pow(2, f) | |
if (graphicsContext.screenWidth / tileSize < 22) | |
math.pow(2, f).toInt | |
else | |
tileSizeCalc(f+1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment