Skip to content

Instantly share code, notes, and snippets.

@johansjoberg
Created January 6, 2012 22:43
Show Gist options
  • Save johansjoberg/1572791 to your computer and use it in GitHub Desktop.
Save johansjoberg/1572791 to your computer and use it in GitHub Desktop.
Testing... tailrec optimization with annotation
@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