@deedlit/

Beating TREE(3) using Buchholz Hydra (with Ruby)

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
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
s=->t{*v,u=t;t==1?[]:v<<s[u]}
r=->t{*v,u=t;$b=t[0][0]?$b:t;u==1?v<<s[$b]:u[0]?v+[r[u]]*$c:v}
$c=2
a=[],[1,[]]
(print a,"\n";$c*=1;a=r[a])while a[0]
$c


#def S(t)
#  u, *v = t
#  if t == 1 or t == 0
#    return 0
#  else
#    return [S(u)] + v
#  end
#end  

#def R(t)
#  u, *v = t
#  if t[-1] == 0
#    $b = t
#  end
#  if u == 1
#    return [S($b)] + v
#  elsif u == [] or u == 0
#    return v
#  else
#    return [R(u)]*$c + v
#  end
#end

#$c = 2

#a = [[[0,0],0],0]

#z = 5
#while a != [] do
#  print a,"\n"
#  a = R(a)
#  z -= 1
#end

ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]