Microsoft MakeCode

1 in a million with two games


Actually might be 1 and a million


Same here as well

2 Likes

Tell me if you think this might be a million
Take a pic

Fun!

Both games would average out to one chance in a million to win, yes. For the first one, you’re nesting three 1% chance conditions. That’s 1/100 x 1/100 x 1/100, which is 1/1,000,000.

For the second one, you’re pulling numbers that range between 1 and 1,000,000. There is roughly[1] one chance in a million to pull any single number, so, yes, there is one chance in a million that the numbers will match.

For the first game, you could simplify the logic a little bit:

For the second game, you’re only interested in comparing the two numbers when value2 changes, so you don’t need that comparison in the on game update loop. You only need to check when value2 changes:

Nice work! That was a lot of fun! No, I didn’t win in either game. :slight_smile:


[1] For those who dig a little deeper, MakeCode Arcade, I believe, relies on JavaScript’s math.random() function which, according to Mozilla, is a pseudo-random generator that approximates uniform distribution: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

1 Like

Thanks @AlexK! The changes in the game sound better. I’m someone who is usually on the safe side. I tried making a 1 in a million game about in July I believe. Thanks for the feedback! I feel like I’m over doing it but thanks for simplifying it!

1 Like

Honestly like short games with short code or long games with long code

Is the first game a template?

1 Like

No its the game. Press and hold A to roll and the chances of getting to it is actually 1/1000000

I have a messy desk, and happened to have the necessary parts for a test jig at hand. I’ll let you know how long it takes:

Jeff :slight_smile:

5 Likes

That is the best thing ever! How long do you plan on running that for?

I left it running while I left my office for a bit, and over the course of about an hour, it had tried 15,778 tries without a win. I do need my computer again before the day is out, though, so I stopped it. As fun as mechanical testing is, I think automated testing in software will probably be faster :slight_smile:

Jeff

Yeah, automated testing will usually be a bit faster :slight_smile: If anyone wants to run it in dev tools, under the ---simulator:

const board = pxsim.board();
let on = true;
setInterval(() => {
    board.setButton(5 /** A **/, on);
    on = !on;
}, 10 /** ms **/);

(just a general note for anyone reading, note that running things in dev tools can be a safety concern if you’re e.g. running something on a site with a log in - it’s best to avoid running any code you do not understand / you didn’t write yourself there / just be cautious in general that you aren’t sending your data to someone or anything of the sort.)

5 Likes

Man everyone is looking for (well I don’t want to say cheats) new ideas to beat this game.

2 Likes

I mean you may not want to say cheats but I’m not against it; name of the gif in my post:

2 Likes

But seriously, I don’t know javascript or python but that is cool! :grinning:

1 Like

Big Brains!! I’m not against your javascript but robotics or javascript is a good way to put it.

1 Like

Here is the problem with both of your ideas @jwunderl and @FlyingFox, when you spam A, who knows when you will win? Then there is the part where you do win but never get to see the victory

Ah good point, here’s a version that will rain confetti and say you win when it’s over without restarting:

1 Like

That solves the A button problem

Have you been leaving it on all night

Question: Does it delete the number you roll after you roll it so you get a higher chance of winning as you go on?