-
Notifications
You must be signed in to change notification settings - Fork 0
/
CalculationLogic.cs
121 lines (112 loc) · 3.44 KB
/
CalculationLogic.cs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ApeirophobiaCodeCracker
{
internal class CalculationLogic
{
public static string? redPhase;
public static string? greenPhase;
public static string? bluePhase;
public static string? greyPhase;
public static string? yellowPhase;
public static string? purplePhase;
public static string? orangePhase;
/*
Probably not the best way to go about calculating each bit and adding on to each other but it works :)
Here we just take the input and set the first phase = to the input plus the corresponding value
(We're appending the corresponding value to the end of the string, not adding two integers)
We repeat this for each phase, if the input is 0 or null, the phase is essentially skipped
*/
public static void RedPhase(string redinput)
{
string redString = redinput;
if(redString != "0" && redString != "")
{
redPhase = redString + "1";
}
else
{
redPhase = "";
}
}
public static void GreenPhase(string greeninput)
{
string greenString = greeninput;
if (greenString != "0" && greenString != "")
{
greenPhase = redPhase + greenString + "2";
}
else
{
greenPhase = redPhase + "";
}
}
public static void BluePhase(string blueinput)
{
string blueString = blueinput;
if(blueString != "0" && blueString != "")
{
bluePhase = greenPhase + blueString + "3";
}
else
{
bluePhase = greenPhase + "";
}
}
public static void GreyPhase(string greyinput)
{
string greyString = greyinput;
if (greyString != "0" && greyString != "")
{
greyPhase = bluePhase + greyString + "4";
}
else
{
greyPhase = bluePhase + "";
}
}
public static void YellowPhase(string yellowinput)
{
string yellowString = yellowinput;
if(yellowString != "0" && yellowString != "")
{
yellowPhase = greyPhase + yellowString + "5";
}
else
{
yellowPhase = greyPhase + "";
}
}
public static void PurplePhase(string purpleinput)
{
string purpleString = purpleinput;
if(purpleString != "0" && purpleString != "")
{
purplePhase = yellowPhase + purpleString + "6";
}
else
{
purplePhase = yellowPhase + "";
}
}
public static void OrangePhase(string orangeinput)
{
string orangeString = orangeinput;
if(orangeString != "0" && orangeString != "")
{
orangePhase = purplePhase + orangeString + "7";
}
else
{
orangePhase = purplePhase + "";
}
}
public static void FinishResultCalculation()
{
Form1.result = orangePhase;
}
}
}