Learn Roulette Video Source & Info:
In this video, you will Learn the Step by Step Processs on to How to Create a Roulette Table Power Apps.
****Note the code in this video is below in the description
HOW TO PLAY ROULETTE
THE BASIC RULES WHEN PLAYING ROULETTE
Roulette starts with players making bets.
The croupier (or dealer) throws a ball into the spinning roulette wheel. Players can still makes bets within the process. While the ball is rolling at the roulette wheel, the croupier/dealer announces: “No more bets.” At that point players are not allowed making bets
The ball lands on a number in the roulette wheel. If there are winners who bet the number, section or color, they will be rewarded according of their betting odds.
*****Here is the code for creating the collection
UpdateContext({Counter: Counter +1}); Collect(RouletteCollection, {SpinNo: Counter, WinningNumbers: First(Shuffle([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36])).Value})
******Here is the code to Sort the Collection by Descending Order
SortByColumns(RouletteCollection,”SpinNo”,SortOrder.Descending)
*****Here is the code for the Winning Number Last(RouletteCollection.WinningNumbers).WinningNumbers
******Here is the code for the Fill Propert of the Winning Number
Switch(TextInput1.Text,
“1”,RGBA(255, 0, 0, 1),
“2”,RGBA(0, 0, 0, 1),
“3”,RGBA(255, 0, 0, 1),
“4”,RGBA(0, 0, 0, 1),
“5”,RGBA(255, 0, 0, 1),
“6”,RGBA(0, 0, 0, 1),
“7”,RGBA(255, 0, 0, 1),
“8”,RGBA(0, 0, 0, 1),
“9”,RGBA(255, 0, 0, 1),
“10”,RGBA(0, 0, 0, 1),
“11”,RGBA(0, 0, 0, 1),
“12”,RGBA(255, 0, 0, 1),
“13”,RGBA(0, 0, 0, 1),
“14”,RGBA(255, 0, 0, 1),
“15”,RGBA(0, 0, 0, 1),
“16”,RGBA(255, 0, 0, 1),
“17”,RGBA(0, 0, 0, 1),
“18”,RGBA(255, 0, 0, 1),
“19”,RGBA(255, 0, 0, 1),
“20”,RGBA(0, 0, 0, 1),
“21”,RGBA(255, 0, 0, 1),
“22”,RGBA(0, 0, 0, 1),
“23”,RGBA(255, 0, 0, 1),
“24”,RGBA(0, 0, 0, 1),
“25”,RGBA(255, 0, 0, 1),
“26”,RGBA(0, 0, 0, 1),
“27”,RGBA(255, 0, 0, 1),
“28”,RGBA(0, 0, 0, 1),
“29”,RGBA(0, 0, 0, 1),
“30”,RGBA(255, 0, 0, 1),
“31”,RGBA(0, 0, 0, 1),
“32”,RGBA(255, 0, 0, 1),
“33”,RGBA(0, 0, 0, 1),
“34”,RGBA(255, 0, 0, 1),
“35”,RGBA(0, 0, 0, 1),
“36”,RGBA(255, 0, 0, 1)
)
****Here is the code for the Fil Property of the Top, Middle and Bottom Row
If(ThisItem.’Top Row’=Value(TextInput1.Text),RGBA(0, 255, 0 ,1),
Switch(ThisItem.’Top Row’,
3,RGBA(255, 0, 0, 1),
6,RGBA(0, 0, 0, 1),
9,RGBA(255, 0, 0, 1),
12,RGBA(255, 0, 0, 1),
15,RGBA(0, 0, 0, 1),
18,RGBA(255, 0, 0, 1),
21,RGBA(255, 0, 0, 1),
24,RGBA(0, 0, 0, 1),
27,RGBA(255, 0, 0, 1),
30,RGBA(255, 0, 0, 1),
33,RGBA(0, 0, 0, 1),
36,RGBA(255, 0, 0, 1)
))
If(ThisItem.’Middle Row’=Value(TextInput1.Text),RGBA(0, 255, 0 ,1),
Switch(ThisItem.’Middle Row’,
2,RGBA(0, 0, 0, 1),
5,RGBA(255, 0, 0, 1),
8,RGBA(0, 0, 0, 1),
11,RGBA(0, 0, 0, 1),
14,RGBA(255, 0, 0, 1),
17,RGBA(0, 0, 0, 1),
20,RGBA(0, 0, 0, 1),
23,RGBA(255, 0, 0, 1),
26,RGBA(0, 0, 0, 1),
29,RGBA(0, 0, 0, 1),
32,RGBA(255, 0, 0, 1),
35,RGBA(0, 0, 0, 1)
))
If(ThisItem.’Bottom Row’=Value(TextInput1.Text),RGBA(0, 255, 0 ,1),
Switch(ThisItem.’Bottom Row’,
1,RGBA(255, 0, 0, 1),
4,RGBA(0, 0, 0, 1),
7,RGBA(255, 0, 0, 1),
10,RGBA(0, 0, 0, 1),
13,RGBA(0, 0, 0, 1),
16,RGBA(255, 0, 0, 1),
19,RGBA(255, 0, 0, 1),
22,RGBA(0, 0, 0, 1),
25,RGBA(255, 0, 0, 1),
28,RGBA(0, 0, 0, 1),
31,RGBA(0, 0, 0, 1),
34,RGBA(255, 0, 0, 1)
))
Video covers the following:
✅ Create an Update Context Variable in PowerApps
✅ Create a First Function
✅ Create a Last Function
✅ Create a Shuffle Function
✅ Create a Collection with 2 Columns
✅ Use SortByColumns on a Collection
✅ Apply Conditional Formatting on a Switch Function
✅ Populate Dropdowns using the Items Property
✅ Use a Mod Function
✅ Create an If Statement to Compare Values in a Dropdown to Text in a Text Input
✅ Change the Format of a Text Input to Currency
✅ Apply Conditional Formatting on a Switch Function
✅ Change the Data Source from SharePoint to a Collection
✅ Apply Conditional Formatting on the Winning Number using an If Statement
✅ Design the Roulette Table
Source: YouTube
Really neat idea! Love it!