pong-bot bugfixes
This commit is contained in:
parent
9c8d04114c
commit
5bcd7260d3
4 changed files with 33 additions and 7 deletions
24
games/Pong-bots/test.rb
Normal file
24
games/Pong-bots/test.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
def func1
|
||||
i=0
|
||||
while i<=2
|
||||
puts "func1 at: #{Time.now}"
|
||||
sleep(2)
|
||||
i=i+1
|
||||
end
|
||||
end
|
||||
|
||||
def func2
|
||||
j=0
|
||||
while j<=2
|
||||
puts "func2 at: #{Time.now}"
|
||||
sleep(1)
|
||||
j=j+1
|
||||
end
|
||||
end
|
||||
|
||||
puts "Started At #{Time.now}"
|
||||
t1=Thread.new{func1()}
|
||||
t2=Thread.new{func2()}
|
||||
puts "End at #{Time.now}"
|
Reference in a new issue