# Short Project 4: Chance Game

Flash and JavaScript are required for this feature.

In this video, one of the student teams demonstrates their projects, an Arduino based virtual ruler and a lottery game. Components used: Ultrasonic sensor, Breadboards, LEDs, Servo, Arduino UNO.

PRESENTER 1: It randomly chooses a number and flashes five times. And if it chooses a number between 1 to 5, you have a chance to win a lottery. We have lotteries here. By the way, there's [? 50 ?] percent of chances that you get punched in the face or like a punishment, right?

PRESENTER 2: Yeah, some sort of punishment.

PRESENTER 1: Yeah, some sort of punishment. And we welcome all of you to try it.

PRESENTER 2: Mine is-- I named it an Imprecise Ardruino Ruler. So this is like an ultrasonic sensor in that it can tell distance. So I set it up with a series of lights. So we'll just have this piece of cardboard. If you have just a piece of cardboard over here, it shows that it's five centimeters away. If you move it farther away, more like [INAUDIBLE]

PRESENTER 1: So eventually, we want to combine them together, like how many lights show on there, they would display the number over here. And then win the lottery. But since they're on two different ardruino boards we just make it separate and play with the LEDs right now.

So what I would suggest right now, if somebody is going to receive either punishment or reward, they get close to the sensor and get the reward from Franklin over there. So we have to be careful. OK,

AUDIENCE: So I say, like, two. So right, I just guess the number two.

PRESENTER 1: Yeah, you don't have to guess it, it will randomly choose it.

AUDIENCE: Oh, OK.

PRESENTER 1: So you're completely relying on God.

PRESENTER 2: It slowly lights up.

AUDIENCE: What's the percentage on it?

PRESENTER 2: It's very imprecise. This lights up from distance from five to 10 centimeters. This lights up when the object is 10 to 15, this is 15 to 20 and so on.