#1

A Solution has been found. Here is the finished project: https://c.gethopscotch.com/p/zu22zhcna
https://c.gethopscotch.com/p/zthtmow8h
It’s completely impossible as long as you don’t mash the screen. I tried to make a possible version where it started with 14 marbles and you could win if you wanted because someone (Petrichor) remixed and told me I should do that. But for some reason, if I tried changing the number to 14, the computer just skips it’s turn and wins again. I tried looking if anything was making it do that, but I didn’t find anything. Can anyone help me? Thanks!

#2
1. The computer’s a cheater.
2. I don’t know… the “I want to win” button doesn’t work?

#3
1. I guess you can say the computer is cheating… just look up the game Nim and you’ll see.
2. There is no “I want to win” button, so I don’t know what you mean.

#4

I won!

But I cheated

#5

I didn’t want this to just turn into a “Hey! Let’s see who can beat my game!” topic.

#6

It’s completely impossible as long as you don’t mash the screen. I tried to make a possible version where it started with 14 marbles and you could win if you wanted because someone (Petrichor) remixed and told me I should do that. But for some reason, if I tried changing the number to 14, the computer just skips it’s turn and wins again. I tried looking if anything was making it do that, but I didn’t find anything. Can anyone help me? Thanks!

#7

This works

#8

The problem is that the computer skips a turn once and I lose every time.

#9

From what I saw, it seems like you have coded ina case for every possible game state. In a similar game I made, I used a conditional to check if the current number is a multiple of four. I did this using the modulo operator. If it is, I had it take a random amount from one to three. If it isn’t, I had it take enough to where it is. I made a simplified version here.

#10

Thanks a nonillion! I will fix my game up now and publish it. Thanks again for the help!

#11

Here it is! https://c.gethopscotch.com/p/zu22zhcna

#12

*Modulo

#13

It is also called module operator (or at least that is how I call it too, and my book says that too)

#14

Well, either way works, I guess.

#15

Sorry to just reply here but this is XxZRMxX from hopscotch… I was the one asking for help and advice

#16

Errr… Yes. My general topic is the one.