Magic Random Number Generator

This is another android phone app that I wrote with AI using the Cordova platform. This was completely coded by the AI. Basically it is a random generator for randomly selecting numbers, rolling dice, or picking cards. But with a twist. The magician can control the outcomes.

This looks like a run of the mill random generator, and it is. You can roll dice, choose cards, pick numbers. But I wanted an app on my phone so I could perform the “finding the aces” trick described in https://robertjwallace.com/dice-decider/. But as long I was going to create a phone app, I decided I might as well handle cards and random numbers as well.

In dice mode I can switch it from generating 4 random dice, to forcing the middle two dice to add up to seven. This is so I can perform the “Dice Decider” trick.

In card mode I can switch it to generate cards in the stack order that I use. This allow me to have a spectator generate a “random” card and I can then read their mind.

In number mode I can switch it to generate up to six numbers that I defined.

The lower left corner of the screen is a secret “hot spot”. If touched, it puts the app into “magic” mode. This mode is indicated by a faint drop shadow on the “button”

Note the slight green drop shadow on the “Dice” button. This indicates the app is in “magic” mode and will make the two center dice add up to 7

Long pressing on the lower left corner takes the app out of magic mode.

This hidden switch lets me show the app working normally and then secretly put it into the “magic” mode. Then after the effect I can put it back to a normal random generator.

The title “Random Generator” is also a switch. When long pressed it opens the settings page where I can define up to six numbers to appear when generating random numbers.

Let’s say I am doing a book test, where I generate two number between 10 and 100. The first number is a page number, the second determines the line and the word on that line.

With the presets above the spectator would get 11 and 27 which would mean page 11, line 2, and word 7.

Since I can define up to six numbers, I can have three pairs set up. That means I can repeat the effect, or I can let the spectator choose not to use those numbers and generate a “new” pair.

In card mode I can demonstrate that each time I generate a card it comes up with a random card.

But if I then secretly put it into magic mode, the next generated card will be the card in my stack that follows the last card shown. In the image above the last card was the eight of diamonds. In my stack, the next card is the queen of hearts.

Conclusion

This is why I think using Cordova and an Android phone is so powerful. In a couple of hours I can prototype an app that does exactly what I want. I can then play with it for a while, trying it out on spectators. Then I can go back and tell the AI to make modifications. I have complete control and it costs me nothing, other than my time. An with AI, it doesn’t take that much of my time.

Let me know if you are interested in learning how to write your own apps.

Leave a Reply

Your email address will not be published. Required fields are marked *