-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDivisionViewController.h
More file actions
125 lines (115 loc) · 4.85 KB
/
DivisionViewController.h
File metadata and controls
125 lines (115 loc) · 4.85 KB
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
122
123
124
125
//
// DivisionViewController.h
// MathHelp
//
// Created by Dominic Surrao on 5/16/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DigitField.h"
#import "Utilities.h"
#import "Operation.h"
@interface DivisionViewController : UIViewController {
@public
UITextField *__weak divisorOnes;
UITextField *__weak dividendOnes;
UITextField *__weak dividendTens;
UITextField *__weak dividendHundreds;
UITextField *__weak resultOnes;
UITextField *__weak resultTens;
UITextField *__weak resultHundreds;
UITextField *__weak firstSubtrahendTens;
UITextField *__weak firstSubtrahendHundreds;
UITextField *__weak firstDifferenceOnes;
UITextField *__weak firstDifferenceTens;
UITextField *__weak firstDifferenceHundreds;
UITextField *__weak secondSubtrahendOnes;
UITextField *__weak secondSubtrahendTens;
UITextField *__weak secondSubtrahendHundreds;
UITextField *__weak secondDifferenceOnes;
UITextField *__weak secondDifferenceTens;
UITextField *__weak thirdSubtrahendOnes;
UITextField *__weak thirdSubtrahendTens;
UITextField *__weak thirdDifferenceOnes;
@private
bool isComplete;
int dividend;
int divisor;
int currentLeftOperand;
int currentRightOperand;
int currentSubtractionLeftOperand;
int currentOperationIndex;
int currentMultiplicationTargetIndex;
int currentDivisionTargetIndex;
int currentSubtractionTargetIndex;
int currentCarryTargetIndex;
NSMutableArray *orderedOperationArray;
NSMutableArray *dividendDigitArray;
NSMutableArray *multiplicationTargetArray;
NSMutableArray *divisionTargetArray;
NSMutableArray *subtractionTargetArray;
NSMutableArray *currentMultiplicationTarget;
NSMutableArray *currentSubtractionTarget;
DigitField *currentDivisionTarget;
DigitField *divisorOnesDigitField;
DigitField *resultOnesDigitField;
DigitField *resultTensDigitField;
DigitField *resultHundredsDigitField;
DigitField *dividendHundredsDigitField;
DigitField *dividendTensDigitField;
DigitField *dividendOnesDigitField;
DigitField *firstSubtrahendHundredsDigitField;
DigitField *firstSubtrahendTensDigitField;
DigitField *firstDifferenceHundredsDigitField;
DigitField *firstDifferenceTensDigitField;
DigitField *firstDifferenceOnesDigitField;
DigitField *secondSubtrahendHundredsDigitField;
DigitField *secondSubtrahendTensDigitField;
DigitField *secondSubtrahendOnesDigitField;
DigitField *secondDifferenceTensDigitField;
DigitField *secondDifferenceOnesDigitField;
DigitField *thirdSubtrahendTensDigitField;
DigitField *thirdSubtrahendOnesDigitField;
DigitField *thirdDifferenceOnesDigitField;
NSMutableArray *_executedOps;
Utilities *_utils;
}
@property (nonatomic, weak) IBOutlet UITextField *divisorOnes;
@property (nonatomic, weak) IBOutlet UITextField *dividendOnes;
@property (nonatomic, weak) IBOutlet UITextField *dividendTens;
@property (nonatomic, weak) IBOutlet UITextField *dividendHundreds;
@property (nonatomic, weak) IBOutlet UITextField *resultOnes;
@property (nonatomic, weak) IBOutlet UITextField *resultTens;
@property (nonatomic, weak) IBOutlet UITextField *resultHundreds;
@property (nonatomic, weak) IBOutlet UITextField *firstSubtrahendTens;
@property (nonatomic, weak) IBOutlet UITextField *firstSubtrahendHundreds;
@property (nonatomic, weak) IBOutlet UITextField *firstDifferenceOnes;
@property (nonatomic, weak) IBOutlet UITextField *firstDifferenceTens;
@property (nonatomic, weak) IBOutlet UITextField *firstDifferenceHundreds;
@property (nonatomic, weak) IBOutlet UITextField *secondSubtrahendOnes;
@property (nonatomic, weak) IBOutlet UITextField *secondSubtrahendTens;
@property (nonatomic, weak) IBOutlet UITextField *secondSubtrahendHundreds;
@property (nonatomic, weak) IBOutlet UITextField *secondDifferenceOnes;
@property (nonatomic, weak) IBOutlet UITextField *secondDifferenceTens;
@property (nonatomic, weak) IBOutlet UITextField *thirdSubtrahendOnes;
@property (nonatomic, weak) IBOutlet UITextField *thirdSubtrahendTens;
@property (nonatomic, weak) IBOutlet UITextField *thirdDifferenceOnes;
@property (nonatomic, assign) int divisor;
@property (nonatomic, assign) int dividend;
@property (nonatomic, strong) NSMutableArray *orderedOperationArray;
@property (nonatomic, strong) NSMutableArray *dividendDigitArray;
@property (nonatomic, strong) NSMutableArray *multiplicationTargetArray;
@property (nonatomic, strong) NSMutableArray *divisionTargetArray;
@property (nonatomic, strong) NSMutableArray *subtractionTargetArray;
@property (nonatomic, strong) NSMutableArray *currentMultiplicationTarget;
@property (nonatomic, strong) NSMutableArray *currentSubtractionTarget;
@property (nonatomic, strong) DigitField *currentDivisionTarget;
- (IBAction)doNextStep:(id)sender;
- (IBAction)undoLastStep:(id)sender;
- (IBAction)getHint:(id)sender;
- (void) configureDigitFields;
- (void) disableAllDigitFields;
- (Operation *) getNextOp;
- (Operation *) getLastOp;
- (NSString *) getFinalResultMessage;
@end