To content | To menu | To search

a1ex.net blog

Writing an android app with F#

I recently read and I was reminded that F# can be used simultaneously with other language projects in .NET solutions.

I wrote my first android app this way, using Xamarin.Forms in C# to call F# functions written in a F# library.

Fantasy Flight Games made a Star Wars RPG game a few years ago, and that included special dice. I was too cheap to buy said dice, and I got sick of looking at the d12-to-star-wars-dice conversion chart, so I wrote the logic of the dice results into an F# library such that if I can tell the library to roll X numbers of Y type dice, and give me the result in terms of Star Wars RPG dice terms (success, failure, threat, etc.)

Then, using Xamarin.Forms, I created a simple list view that has a label of each kind of dice, and a number ticker that increases or decreases the amount of dice by one. Clicking the 'roll the dice' button at the bottom results in a result giving overall success or failure of a given check, then the raw dice results in terms of Star Wars RPG setups.

Hello world

It's a hello world post, you're not supposed to say something on a hello world besides hello world.