-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.pseudocode
72 lines (56 loc) · 947 Bytes
/
test.pseudocode
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
procedure sayhi(name)
print("hello"+name)
endprocedure
function outputzero(x,y)
return 0 // Comment 1
endfunction
// Comment 2
x=3
print(x)
for i = 1 to 10
print(i)
next i
while x != 5
print(x)
x+=1
endwhile
do
answer=input("What's the password?")
until answer=="computer"
if x==5 OR x == 3^2
print(x)
elseif x==7
print(x+6)
else
print("hello, world")
endif
switch x:
case 1:
print("it\'s 1")
case 5:
print("it\'s 5")
endswitch
y="hello"
print(y.length)
print(y.substring(1,2))
sayhi("chinmaya")
array names[5]
names[0]="Ahmad"
names[1]="Ben"
names[2]="Catherine"
names[3]="Dana"
names[4]="Elijah"
print(names[3])
array board[8,8]
board[outputzero(5,4),0]="rook"
myFile = openRead("sample.txt")
x = myFile.readLine()
myFile.close()
myFile = openRead("sample.txt")
while NOT myFile.endOfFile()
print(myFile.readLine())
endwhile
myFile.close()
myFile = openWrite("sample.txt")
myFile.writeLine("Hello World")
myFile.close()