From 14b74242182122c819683a7264e1362214048601 Mon Sep 17 00:00:00 2001
From: Syndamia <kami02882@gmail.com>
Date: Fri, 29 Nov 2019 15:35:13 +0200
Subject: Added "Who wants to be a millionare?" - Africa PowerPoint project

Added the presentation, some README files to explain a bit and added the code (extracted it from the presentation)
---
 .../Extracted code/Slide2.cls                      | 172 +++++++++++++++++++++
 1 file changed, 172 insertions(+)
 create mode 100644 Who wants to become a millionare - Africa (BG)/Extracted code/Slide2.cls

(limited to 'Who wants to become a millionare - Africa (BG)/Extracted code/Slide2.cls')

diff --git a/Who wants to become a millionare - Africa (BG)/Extracted code/Slide2.cls b/Who wants to become a millionare - Africa (BG)/Extracted code/Slide2.cls
new file mode 100644
index 0000000..32a5d00
--- /dev/null
+++ b/Who wants to become a millionare - Africa (BG)/Extracted code/Slide2.cls	
@@ -0,0 +1,172 @@
+VERSION 1.0 CLASS
+BEGIN
+  MultiUse = -1  'True
+END
+Attribute VB_Name = "Slide2"
+Attribute VB_GlobalNameSpace = False
+Attribute VB_Creatable = False
+Attribute VB_PredeclaredId = True
+Attribute VB_Exposed = True
+
+Const corrAns1 As String = "B"
+Const corrAns2 As String = "D"
+Const corrAns3 As String = "B"
+Const corrAns4 As String = "C"
+Const corrAns5 As String = "A"
+Const corrAns6 As String = "D"
+Const corrAns7 As String = "D"
+Const corrAns8 As String = "C"
+Const corrAns9 As String = "A"
+Const corrAns10 As String = "A"
+Const corrAns11 As String = "D"
+Const corrAns12 As String = "B"
+Const corrAns13 As String = "C"
+Const corrAns14 As String = "A"
+Const corrAns15 As String = "C"
+
+Const red As Long = 16724736
+Const orange As Long = 3381759
+Const green As Long = 3394611
+Const black As Long = 0
+
+Private Sub cmdStartGame_Click()
+
+ResetGame
+SlideShowWindows(1).View.Next
+
+End Sub
+
+'Using lifelines
+
+Public Sub UseFiftyFifty()
+
+UseLifeLine "FiftyFifty"
+
+End Sub
+
+Public Sub UsePhoneFriend()
+
+UseLifeLine "PhoneFriend"
+
+End Sub
+
+Public Sub UseAskAudience()
+
+UseLifeLine "AskAudience"
+
+End Sub
+
+Private Sub UseLifeLine(lifeLineName As String)
+
+Slide3.DisabledLifeLine lifeLineName, True
+Slide4.DisabledLifeLine lifeLineName, True
+Slide5.DisabledLifeLine lifeLineName, True
+Slide6.DisabledLifeLine lifeLineName, True
+Slide7.DisabledLifeLine lifeLineName, True
+Slide8.DisabledLifeLine lifeLineName, True
+Slide9.DisabledLifeLine lifeLineName, True
+Slide10.DisabledLifeLine lifeLineName, True
+Slide11.DisabledLifeLine lifeLineName, True
+Slide12.DisabledLifeLine lifeLineName, True
+Slide13.DisabledLifeLine lifeLineName, True
+Slide14.DisabledLifeLine lifeLineName, True
+Slide15.DisabledLifeLine lifeLineName, True
+Slide16.DisabledLifeLine lifeLineName, True
+Slide17.DisabledLifeLine lifeLineName, True
+
+
+End Sub
+
+'Getting values
+
+Public Function GetCorrAnswer(questionIndex As Integer) As String
+
+Select Case questionIndex
+    Case 1: GetCorrAnswer = corrAns1
+    Case 2: GetCorrAnswer = corrAns2
+    Case 3: GetCorrAnswer = corrAns3
+    Case 4: GetCorrAnswer = corrAns4
+    Case 5: GetCorrAnswer = corrAns5
+    Case 6: GetCorrAnswer = corrAns6
+    Case 7: GetCorrAnswer = corrAns7
+    Case 8: GetCorrAnswer = corrAns8
+    Case 9: GetCorrAnswer = corrAns9
+    Case 10: GetCorrAnswer = corrAns10
+    Case 11: GetCorrAnswer = corrAns11
+    Case 12: GetCorrAnswer = corrAns12
+    Case 13: GetCorrAnswer = corrAns13
+    Case 14: GetCorrAnswer = corrAns14
+    Case 15: GetCorrAnswer = corrAns15
+End Select
+
+End Function
+
+Private Function GetAnswerIndex(answer As String) As Integer
+
+Select Case answer
+    Case "A": GetAnswerIndex = 1
+    Case "B": GetAnswerIndex = 2
+    Case "C": GetAnswerIndex = 3
+    Case "D": GetAnswerIndex = 4
+End Select
+
+End Function
+
+Public Function GetWrongAnsToKeep(questionI As Integer) As String
+Dim keepWrong As Integer
+
+Do
+    keepWrong = Int((4 * Rnd) + 1)
+Loop While keepWrong = GetAnswerIndex(GetCorrAnswer(questionI))
+
+Select Case keepWrong
+    Case 1: GetWrongAnsToKeep = "A"
+    Case 2: GetWrongAnsToKeep = "B"
+    Case 3: GetWrongAnsToKeep = "C"
+    Case 4: GetWrongAnsToKeep = "D"
+End Select
+
+End Function
+
+Public Function GetColor(color As String) As String
+
+Select Case color
+    Case "Red": GetColor = red
+    Case "Orange": GetColor = orange
+    Case "Green": GetColor = green
+    Case "Black": GetColor = black
+End Select
+
+End Function
+
+'Ending Game
+
+Public Sub EndGame(wonMoney As Long)
+
+Slide18.SetPrizeMoney wonMoney
+SlideShowWindows(1).View.GotoSlide 18
+
+End Sub
+
+Public Sub ResetGame()
+
+Slide3.Reset
+Slide4.Reset
+Slide5.Reset
+Slide6.Reset
+Slide7.Reset
+Slide8.Reset
+Slide9.Reset
+Slide10.Reset
+Slide11.Reset
+Slide12.Reset
+Slide13.Reset
+Slide14.Reset
+Slide15.Reset
+Slide16.Reset
+Slide17.Reset
+Slide18.SetPrizeMoney 0
+
+End Sub
+
+'Kamen Mladenov 2019
-- 
cgit v1.2.3

