dimanche 30 août 2020

Best way to put a kotlin program on a website?

I have written a duel simulator in Kotlin for an online video game. The user has to input the combat levels of both players, then how many duels they want to simulate, and then click start and it will recreate the duels and return the win% and other stats to the user. It takes <2 seconds to run 100,000 simulations on my laptop.

I really need help working out how to get this onto a website though because I am only now learning html, css, and javascript. So what should I do, the options I have come across so far are

  1. turn it into an applet/application (but I read this is deprecated in java?) and then embed it into my webpage, or
  2. convert it into JavaScript and have it run on the users browser (but I worry this will be slow, or look laggy, or allow someone else to simply copy the entire thing?), or
  3. just have a form on my page that sends the details the user enters to a server (?) where it runs and then returns the result to the user whilst the user sees some pretty loading animation?

So am I on the right track or way off here? Any advice will be appreciated, like pointers on what to learn and where to look for good information.




Aucun commentaire:

Enregistrer un commentaire