Sign in to follow this  

Game made with an HTML5 P-code. Roulette Markov

Recommended Posts

 There is a roulette game at The p-code was written in HTML5 JavaScript.

The home page is

You can adjust the frequency table for all of the 38 possibilities. You can test the the result of your changes.

It will build a Markov Transition Matrix for Stop at Loss, Stop at Win, and Stop at a number of spins.


The expected value of the game will be given by the Markov Chain.


Share this post

Link to post
Share on other sites

A P-code is similar to a programming language, except it contains only the instruction you want to perform particular tasks. In this case it is to build games that use mathematics. So the P-code Engine contains JavaScript functions that perform these tasks. It also contains the JavaScript programs that facilitate the building of P-code programs.  There are functions for displaying patterns, showing pictures, animation, probability, and many more. New functions are added , when new capabilities are needed.. The name of the JavaScript file is a001.js. You can view this file by asking the browser to view the HTML page. Then click on the a001.js file to view it.,  You are free to copy any of these functions. I have been programming for over 45 years, so I have no problem understanding my JavaScript P-code Engine, but I can understand that others may find it difficult to follow. It was originally written in Java. There are many YouTube videos that explain the use of this P-code Engine. To see them go to As to the colors I used, I'm a mathematician and not an artist. Sorry; I will try to do better.   

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.