-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemorunner.rb
More file actions
48 lines (42 loc) · 903 Bytes
/
demorunner.rb
File metadata and controls
48 lines (42 loc) · 903 Bytes
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
require_relative 'rqcdl'
RQC.new do
@log = []
lastpt = nil
10.times {
@output = sandbox("t1553",'bigadd()')
#@output = sandbox("t1553",'bigflo()')
#@output = sandbox("t1553",'divmd()')
#handle_bigadd(false)
puts @output
}
#handle_bigadd(true)
end
def handle_bigadd(final=false)
if !final then
@output.split("\n").each {|line|
if line.include?("<Success>") then lastpt = true
elsif line.include?("<Error>") then lastpt = false
elsif line.include?("[Case]") then @log << [lastpt,eval(line[6...line.length])]
end
}
else
puts "\n\n\n"
tru1=[]
tru2=[]
fal1=[]
fal2=[]
@log.each{|x| if x[0] then tru1<<x[1][0]; tru2<<x[1][1]; else fal1<<x[1][0]; fal2<<x[1][1];end}
puts "True Val 1"
puts tru1
puts "\n\n\n\n"
puts "True Val 2"
puts tru2
puts "\n\n\n\n"
puts "False Val 1"
puts fal1
puts "\n\n\n\n"
puts "False Val 2"
puts fal2
puts "\n\n\n\n"
end
end