-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCS1101S Studio S2
106 lines (91 loc) · 1.48 KB
/
CS1101S Studio S2
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
function biggie_size(combo)
{
return combo + 4;
}
function unbiggie_size(combo)
{
return combo - 4;
}
function is_biggie_size(combo)
{
if(combo > 4 && combo < 9)
{
return true;
}
else
{
return false;
}
}
function is_valid(combo)
{
if(combo > 0 && combo < 9)
{
return true;
}
else
{
return false;
}
}
function combo_price(combo)
{
if(is_biggie_size(combo))
{
return (combo - 4) * 1.17 + 0.50;
}
else
{
return combo * 1.17;
}
}
function combo_price1(combo)
{
return is_biggie_size ? unbiggie_size(combo) * 1.17 +0.5 : combo * 1.17;
}
function empty_order()
{
return 0;
}
function add_to_order(previous_order,new_combo)
{
return previous_order * 10 + new_combo;
}
function last_combo(combo)
{
return combo % 10;
}
function other_combo(combo)
{
const y = combo % 10;
return (combo - y) / 10;
}
function other_combo1(combo)
{
return (combo - last_combo(combo)) / 10;
}
function other_combo2(combo)
{
return math_trunc(combo/10);
}
function other_combo3(combo)
{
return math_floor(combo/10);
}
function combo_at(combo,order_index)
{
if(order_index > 0)
{
return combo_at(other_combo(combo),order_index-1);
}
else
{
return last_combo(combo);
}
}
function combo_at1(combo,order_index)
{
return order_index > 0
? combo_at(other_combo(combo),order_index-1)
: last_combo(combo);
}