Skip to content

Instantly share code, notes, and snippets.

@j5ik2o
Created March 8, 2016 09:47
Show Gist options
  • Select an option

  • Save j5ik2o/ef1e100e0374b5e2c30f to your computer and use it in GitHub Desktop.

Select an option

Save j5ik2o/ef1e100e0374b5e2c30f to your computer and use it in GitHub Desktop.

ちょー稼ぐ!!!

import scala.scalajs.js
import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport

@JSExport
object Main extends JSApp {
  @JSExport
  override def main(): Unit = {
    import API._
    start()
    loop(() => work(), 1) // ちょー稼ぐ!
  }
}

@js.native
object API extends js.GlobalScope {
  def start(): Unit = js.native
  def work(): Unit = js.native
  def loop(f: js.Function0[Unit], msec: Int): Unit = js.native
  def purchase(id: Int): Unit = js.native
  def print(obj: Any): Unit = js.native
  def cash: Long = js.native
  def items: Long = js.native
  def prices: Long = js.native
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment