Skip to content

Commit 1f0b468

Browse files
committed
Added some file io functions, fixed arith1 tests
1 parent c227096 commit 1f0b468

12 files changed

Lines changed: 260 additions & 52 deletions

File tree

RhodusIDE/rhodusIDE.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,8 @@
953953
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
954954
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
955955
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
956-
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
957956
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
957+
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
958958
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
959959
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
960960
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

RhodusIDE/ufMain.dfm

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ object frmMain: TfrmMain
22
Left = 0
33
Top = 0
44
Caption = 'Rhodus IDE'
5-
ClientHeight = 494
6-
ClientWidth = 1242
5+
ClientHeight = 864
6+
ClientWidth = 1397
77
Color = clBtnFace
88
Font.Charset = DEFAULT_CHARSET
99
Font.Color = clWindowText
@@ -18,20 +18,20 @@ object frmMain: TfrmMain
1818
object Panel1: TPanel
1919
Left = 0
2020
Top = 0
21-
Width = 1242
21+
Width = 1397
2222
Height = 86
2323
Margins.Left = 5
2424
Margins.Top = 5
2525
Margins.Right = 5
2626
Margins.Bottom = 5
2727
Align = alTop
2828
TabOrder = 0
29-
ExplicitWidth = 1863
29+
ExplicitWidth = 1383
3030
DesignSize = (
31-
1242
31+
1397
3232
86)
3333
object lblVersion: TLabel
34-
Left = 1026
34+
Left = 1181
3535
Top = 18
3636
Width = 77
3737
Height = 25
@@ -41,6 +41,7 @@ object frmMain: TfrmMain
4141
Margins.Bottom = 5
4242
Anchors = [akTop, akRight]
4343
Caption = 'lblVersion'
44+
ExplicitLeft = 1026
4445
end
4546
object Label1: TLabel
4647
Left = 345
@@ -96,7 +97,7 @@ object frmMain: TfrmMain
9697
Left = 344
9798
Top = 39
9899
Width = 217
99-
Height = 23
100+
Height = 33
100101
Margins.Left = 5
101102
Margins.Top = 5
102103
Margins.Right = 5
@@ -111,14 +112,14 @@ object frmMain: TfrmMain
111112
Left = 0
112113
Top = 86
113114
Width = 278
114-
Height = 408
115+
Height = 778
115116
Margins.Left = 5
116117
Margins.Top = 5
117118
Margins.Right = 5
118119
Margins.Bottom = 5
119120
Align = alLeft
120121
TabOrder = 1
121-
ExplicitHeight = 655
122+
ExplicitHeight = 771
122123
object DirectoryListBox1: TDirectoryListBox
123124
Left = 1
124125
Top = 1
@@ -132,15 +133,12 @@ object frmMain: TfrmMain
132133
ItemHeight = 25
133134
TabOrder = 0
134135
OnChange = DirectoryListBox1Change
135-
ExplicitLeft = 2
136-
ExplicitTop = 2
137-
ExplicitWidth = 274
138136
end
139137
object FileListBox1: TFileListBox
140138
Left = 1
141139
Top = 349
142140
Width = 276
143-
Height = 58
141+
Height = 428
144142
Margins.Left = 5
145143
Margins.Top = 5
146144
Margins.Right = 5
@@ -149,29 +147,26 @@ object frmMain: TfrmMain
149147
ItemHeight = 25
150148
TabOrder = 1
151149
OnClick = FileListBox1Click
152-
ExplicitLeft = 2
153-
ExplicitTop = 350
154-
ExplicitWidth = 274
155-
ExplicitHeight = 304
150+
ExplicitHeight = 421
156151
end
157152
end
158153
object Panel3: TPanel
159154
Left = 278
160155
Top = 86
161-
Width = 964
162-
Height = 408
156+
Width = 1119
157+
Height = 778
163158
Margins.Left = 5
164159
Margins.Top = 5
165160
Margins.Right = 5
166161
Margins.Bottom = 5
167162
Align = alClient
168163
TabOrder = 2
169-
ExplicitWidth = 1585
170-
ExplicitHeight = 655
164+
ExplicitWidth = 1105
165+
ExplicitHeight = 771
171166
object Splitter1: TSplitter
172167
Left = 1
173-
Top = 43
174-
Width = 962
168+
Top = 413
169+
Width = 1117
175170
Height = 4
176171
Cursor = crVSplit
177172
Margins.Left = 5
@@ -185,8 +180,8 @@ object frmMain: TfrmMain
185180
end
186181
object moutput: TMemo
187182
Left = 1
188-
Top = 47
189-
Width = 962
183+
Top = 417
184+
Width = 1117
190185
Height = 360
191186
Margins.Left = 5
192187
Margins.Top = 5
@@ -202,15 +197,14 @@ object frmMain: TfrmMain
202197
ScrollBars = ssBoth
203198
TabOrder = 0
204199
StyleElements = [seClient, seBorder]
205-
ExplicitLeft = 2
206-
ExplicitTop = 294
207-
ExplicitWidth = 1582
200+
ExplicitTop = 410
201+
ExplicitWidth = 1103
208202
end
209203
object editor: TMemo
210204
Left = 1
211205
Top = 1
212-
Width = 962
213-
Height = 42
206+
Width = 1117
207+
Height = 412
214208
Margins.Left = 5
215209
Margins.Top = 5
216210
Margins.Right = 5
@@ -233,10 +227,8 @@ object frmMain: TfrmMain
233227
ScrollBars = ssBoth
234228
TabOrder = 1
235229
StyleElements = [seClient, seBorder]
236-
ExplicitLeft = 2
237-
ExplicitTop = 2
238-
ExplicitWidth = 1582
239-
ExplicitHeight = 288
230+
ExplicitWidth = 1103
231+
ExplicitHeight = 405
240232
end
241233
end
242234
object OpenDialog: TOpenDialog
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The forest is the town of trees
2+
Where they live quite at their ease,
3+
With their neighbors at their side
4+
Just as we in cities wide.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
a = array([[1,2],[3,4],[5,6]])
3+
4+
assertTrue (a.len () == 6)
5+
assertTrue (a.shape() == [3,2])
6+
assertTrue (a.rows () == 3)
7+
assertTrue (a.cols() == 2)
8+
assertTrue (a.tr() == array([[1,3,5],[2,4,6]]))
9+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The forest is the town of trees
2+
Where they live quite at their ease,
3+
With their neighbors at their side
4+
Just as we in cities wide.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
import file
3+
4+
lines = []
5+
f = file.openFile ("testtext.txt", "r")
6+
while not file.eof (f) do
7+
s = file.readLine(f)
8+
lines.append (s)
9+
end
10+
file.closeFile(f)
11+
12+
f = file.openFile ("copy.txt", "w")
13+
for i = 0 to lines.len() - 1 do
14+
file.writeString (f, lines[i] + "\n")
15+
end
16+
file.closeFile(f)
17+
18+
astr = file.readAllText ("copy.txt")
19+
print (astr);
20+

Rhodus_Version_3/TestScripts/arith1.rh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ testUtils.beginTests ("")
154154
testUtils.runtestTrue (math.toRadians (180) == math.pi)
155155
testUtils.runtestTrue (math.toRadians (90) == math.pi/2)
156156

157-
testUtils.runtestTrue (math.sin (30) == -0.988031624092862)
158-
testUtils.runtestTrue (math.cos (30) == 0.154251449887584)
159-
testUtils.runtestTrue (math.tan (30) == -6.40533119664628)
157+
// math.pi/3 = 60 degrees
158+
testUtils.runtestTrue (math.sin (math.pi/3) == 0.866025403784439)
159+
testUtils.runtestTrue (math.cos (math.pi/3) == 0.5)
160+
testUtils.runtestTrue (math.tan (math.pi/3) == 1.73205080756888)
160161
testUtils.runtestTrue (math.acos (0.2) == 1.36943840600457)
161162
testUtils.runtestTrue (math.asin (0.2) == 0.201357920790331)
162163
testUtils.runtestTrue (math.atan (0.2) == 0.197395559849881)

0 commit comments

Comments
 (0)