I have decided for 1045 gliders absorber (due to its simplicity), but I had bug in positioning of the reflectors, after beamwidth 100 recomputed salvo, the even number of lines were in the range. Now when I have finished beamwidth 1000 search and the salvo is by about 30 gliders shorter, I am not sure it will be in the optimal range. It could happen I would choose another number of gliders to be absorbed ... so recomputing one of the absorbers parts, fortunately, they are rather simple. Fortunately optimum range is from 945 to 1098 even gliders (and I bet it would not differ too much when ECCA program changes), so no need for change.
In any case I am stuck. I have to find fast enough comp to compute working ECCA. (Now I am on 76% of "fast" computing ECCA portion having only inc4 instruction to test correctness of positioning/timing). It would be fine to have working ECCA to test rest of the RCT15 program.
(Ignoring fact we do not have seed of destroyal prepared yet).
Unfortunately the target pattern for testing ECCA was wrong. (I have repositioned FSE reflectors and compansated them by shifting p256 starting turners to got p256 sync. But the reaction envelope of the east turner colides with the blocks of HB64 from the p256 gun.)
Unfortunately, the turner cannot be easily repositioned so it would be better to return to the original position shifted 4fd SE. (Both in ECCA one time turners to start the ECCA, and FSE reflectors as well. Recomputation of FSE reflectors would not be that big problem and ECCA should be recomputed anyways. I have planned to use p8 reflector to reset the ECCA whenever signal 2 comes (signal 1 does reset naturaly), but I forgot the other output of the bistable switch should be closed as this is the last (the only) bistable switch. Recomputing this fake ECCA is very time consuming so I prefere the solution to stop the view and correct the positions manualy ... Now while position of FSE reflectors is not corrected, the wrong p256 synchronization causes inc4+reset instruction to do just inc1 and "the other reset should be corrected", anyway the FSE destroyal and glider comming to hit the destroyal seed worked well.
Hmm, I have added one extra glider to the Build FSE reflectors recipe (to anihilate some p1 trash) and the length of the DBCA bit sequence is now 67194, rather to previous 67371. I have expected I would not prolong the sequence as I have carefully chosen the place, but 59*3 bits shortening surprised me. Let us hope I would not need to switch the parity back.
Code: Select all
local showtext, showtextbase = "", ""
local g = golly()
-----------------------------------------------------
local RADIX_LEN = 6 ;
local RADIX_FIL = "000000" ; -- length >= RADIX_LEN
local RADIX = 10^RADIX_LEN ;
BigNum = {} ;
BigNum.mt = {} ;
function BigNum.new( num )
local bignum = {} ;
setmetatable( bignum , BigNum.mt ) ;
BigNum.change( bignum , num ) ;
return bignum ;
end
function BigNum.mt.sub( num1 , num2 )
local temp = BigNum.new() ;
local bnum1 = BigNum.new( num1 ) ;
local bnum2 = BigNum.new( num2 ) ;
BigNum.sub( bnum1 , bnum2 , temp ) ;
return temp ;
end
function BigNum.mt.add( num1 , num2 )
local temp = BigNum.new() ;
local bnum1 = BigNum.new( num1 ) ;
local bnum2 = BigNum.new( num2 ) ;
BigNum.add( bnum1 , bnum2 , temp ) ;
return temp ;
end
function BigNum.mt.tostring( bnum )
local i = 0
local j
local temp = ""
local str
local dotpos
if bnum == nil then
return "nil"
elseif bnum.len > 0 then
for i = bnum.len - 2 , 0 , -1 do
str = tostring(bnum[i])
dotpos = string.find(str..".","%.")
temp = temp .. string.sub(RADIX_FIL..string.sub(str,1,dotpos-1),-RADIX_LEN)
end
str = tostring(bnum[bnum.len - 1])
dotpos = string.find(str..".","%.")
temp = string.sub(str,1,dotpos-1) .. temp
if bnum.signal == '-' then
temp = bnum.signal .. temp
end
return temp
else
return ""
end
end
function BigNum.mt.eq( num1 , num2 )
local bnum1 = BigNum.new( num1 ) ;
local bnum2 = BigNum.new( num2 ) ;
return BigNum.eq( bnum1 , bnum2 ) ;
end
function BigNum.mt.lt( num1 , num2 )
local bnum1 = BigNum.new( num1 ) ;
local bnum2 = BigNum.new( num2 ) ;
return BigNum.lt( bnum1 , bnum2 ) ;
end
function BigNum.mt.le( num1 , num2 )
local bnum1 = BigNum.new( num1 ) ;
local bnum2 = BigNum.new( num2 ) ;
return BigNum.le( bnum1 , bnum2 ) ;
end
function BigNum.mt.unm( num )
local ret = BigNum.new( num )
if ret.signal == "+" then
ret.signal = "-"
else
ret.signal = "+"
end
return ret
end
function BigNum.mt.half( num )
local ret = BigNum.new()
local bnum = BigNum.new( num ) ;
BigNum.half( bnum , ret ) ;
return ret ;
end
BigNum.mt.__metatable = "hidden"
BigNum.mt.__tostring = BigNum.mt.tostring ;
BigNum.mt.__add = BigNum.mt.add ;
BigNum.mt.__sub = BigNum.mt.sub ;
BigNum.mt.__unm = BigNum.mt.unm ;
BigNum.mt.__eq = BigNum.mt.eq ;
BigNum.mt.__le = BigNum.mt.le ;
BigNum.mt.__lt = BigNum.mt.lt ;
setmetatable( BigNum.mt, { __index = "inexistent field", __newindex = "not available", __metatable="hidden" } ) ;
function BigNum.add( bnum1 , bnum2 , bnum3 )
local maxlen = 0 ;
local i = 0 ;
local carry = 0 ;
local signal = "+" ;
local old_len = 0 ;
if bnum1 == nil or bnum2 == nil or bnum3 == nil then
error("Function BigNum.add: parameter nil") ;
elseif bnum1.signal == "-" and bnum2.signal == "+" then
bnum1.signal = "+" ;
BigNum.sub( bnum2 , bnum1 , bnum3 ) ;
if not rawequal(bnum1, bnum3) then
bnum1.signal = "-" ;
end
return 0 ;
elseif bnum1.signal == "+" and bnum2.signal == "-" then
bnum2.signal = "+" ;
BigNum.sub( bnum1 , bnum2 , bnum3 ) ;
if not rawequal(bnum2, bnum3) then
bnum2.signal = "-" ;
end
return 0 ;
elseif bnum1.signal == "-" and bnum2.signal == "-" then
signal = "-" ;
end
old_len = bnum3.len ;
if bnum1.len > bnum2.len then
maxlen = bnum1.len ;
else
maxlen = bnum2.len ;
bnum1 , bnum2 = bnum2 , bnum1 ;
end
for i = 0 , maxlen - 1 do
if bnum2[i] ~= nil then
bnum3[i] = bnum1[i] + bnum2[i] + carry ;
else
bnum3[i] = bnum1[i] + carry ;
end
if bnum3[i] >= RADIX then
bnum3[i] = bnum3[i] - RADIX ;
carry = 1 ;
else
carry = 0 ;
end
end
if carry == 1 then
bnum3[maxlen] = 1 ;
end
bnum3.len = maxlen + carry ;
bnum3.signal = signal ;
for i = bnum3.len, old_len do
bnum3[i] = nil ;
end
return 0 ;
end
function BigNum.sub( bnum1 , bnum2 , bnum3 )
local maxlen = 0 ;
local i = 0 ;
local carry = 0 ;
local old_len = 0 ;
if bnum1 == nil or bnum2 == nil or bnum3 == nil then
error("Function BigNum.sub: parameter nil") ;
elseif bnum1.signal == "-" and bnum2.signal == "+" then
bnum1.signal = "+" ;
BigNum.add( bnum1 , bnum2 , bnum3 ) ;
bnum3.signal = "-" ;
if not rawequal(bnum1, bnum3) then
bnum1.signal = "-" ;
end
return 0 ;
elseif bnum1.signal == "-" and bnum2.signal == "-" then
bnum1.signal = "+" ;
bnum2.signal = "+" ;
BigNum.sub( bnum2, bnum1 , bnum3 ) ;
if not rawequal(bnum1, bnum3) then
bnum1.signal = "-" ;
end
if not rawequal(bnum2, bnum3) then
bnum2.signal = "-" ;
end
return 0 ;
elseif bnum1.signal == "+" and bnum2.signal == "-" then
bnum2.signal = "+" ;
BigNum.add( bnum1 , bnum2 , bnum3 ) ;
if not rawequal(bnum2, bnum3) then
bnum2.signal = "-" ;
end
return 0 ;
end
if BigNum.compareAbs( bnum1 , bnum2 ) == 2 then
BigNum.sub( bnum2 , bnum1 , bnum3 ) ;
bnum3.signal = "-" ;
return 0 ;
else
maxlen = bnum1.len ;
end
old_len = bnum3.len ;
bnum3.len = 0 ;
for i = 0 , maxlen - 1 do
if bnum2[i] ~= nil then
bnum3[i] = bnum1[i] - bnum2[i] - carry ;
else
bnum3[i] = bnum1[i] - carry ;
end
if bnum3[i] < 0 then
bnum3[i] = RADIX + bnum3[i] ;
carry = 1 ;
else
carry = 0 ;
end
if bnum3[i] ~= 0 then
bnum3.len = i + 1 ;
end
end
bnum3.signal = "+" ;
if bnum3.len == 0 then
bnum3.len = 1 ;
bnum3[0] = 0 ;
end
if carry == 1 then
error( "Error in function sub" ) ;
end
for i = bnum3.len , max( old_len , maxlen - 1 ) do
bnum3[i] = nil ;
end
return 0 ;
end
function BigNum.half( bnum1 , bnum2 )
local maxlen = bnum1.len ;
local i = 0 ;
if bnum1 == nil or bnum2 == nil then
error("Function BigNum.half: parameter nil") ;
end
for i = maxlen, bnum2.len-1, 1 do
bnum2[i] = nil ;
end
bnum2.len = maxlen
local carry = 0
if bnum1[maxlen-1]<2 then
bnum2[maxlen-1]=nil
bnum2.len=maxlen-1
carry = bnum1[maxlen-1] % 2
end
for i = bnum2.len - 1,0,-1 do
bnum2[i] = (bnum1[i] + carry * RADIX)//2
carry = bnum1[i] % 2
end
bnum2.signal = bnum1.signal ;
if bnum2.len == 0 then
bnum2.len = 1 ;
bnum2[0] = 0 ;
end
return carry == 1 ;
end
function BigNum.eq( bnum1 , bnum2 )
if BigNum.compare( bnum1 , bnum2 ) == 0 then
return true ;
else
return false ;
end
end
function BigNum.lt( bnum1 , bnum2 )
if BigNum.compare( bnum1 , bnum2 ) == 2 then
return true ;
else
return false ;
end
end
function BigNum.le( bnum1 , bnum2 )
local temp = -1 ;
temp = BigNum.compare( bnum1 , bnum2 )
if temp == 0 or temp == 2 then
return true ;
else
return false ;
end
end
function BigNum.compareAbs( bnum1 , bnum2 )
if bnum1 == nil or bnum2 == nil then
error("Function compare: parameter nil") ;
elseif bnum1.len > bnum2.len then
return 1 ;
elseif bnum1.len < bnum2.len then
return 2 ;
else
local i ;
for i = bnum1.len - 1 , 0 , -1 do
if bnum1[i] > bnum2[i] then
return 1 ;
elseif bnum1[i] < bnum2[i] then
return 2 ;
end
end
end
return 0 ;
end
function BigNum.compare( bnum1 , bnum2 )
local signal = 0 ;
if bnum1 == nil or bnum2 == nil then
error("Funtion BigNum.compare: parameter nil") ;
elseif bnum1.signal == "+" and bnum2.signal == "-" then
return 1 ;
elseif bnum1.signal == "-" and bnum2.signal == "+" then
return 2 ;
elseif bnum1.signal == "-" and bnum2.signal == "-" then
signal = 1 ;
end
if bnum1.len > bnum2.len then
return 1 + signal ;
elseif bnum1.len < bnum2.len then
return 2 - signal ;
else
local i ;
for i = bnum1.len - 1 , 0 , -1 do
if bnum1[i] > bnum2[i] then
return 1 + signal ;
elseif bnum1[i] < bnum2[i] then
return 2 - signal ;
end
end
end
return 0 ;
end
function BigNum.copy( bnum1 , bnum2 )
if bnum1 ~= nil and bnum2 ~= nil then
local i ;
for i = 0 , bnum1.len - 1 do
bnum2[i] = bnum1[i] ;
end
bnum2.len = bnum1.len ;
else
error("Function BigNum.copy: parameter nil") ;
end
end
function BigNum.change( bnum1 , num )
local j = 0 ;
local len = 0 ;
local num = num ;
local l ;
local oldLen = 0 ;
if bnum1 == nil then
error( "BigNum.change: parameter nil" ) ;
elseif type( bnum1 ) ~= "table" then
error( "BigNum.change: parameter error, type unexpected" ) ;
elseif num == nil then
bnum1.len = 1 ;
bnum1[0] = 0 ;
bnum1.signal = "+";
elseif type( num ) == "table" and num.len ~= nil then --check if num is a big number
for i = 0 , num.len do
bnum1[i] = num[i] ;
end
if num.signal ~= "-" and num.signal ~= "+" then
bnum1.signal = "+" ;
else
bnum1.signal = num.signal ;
end
oldLen = bnum1.len ;
bnum1.len = num.len ;
elseif type( num ) == "string" or type( num ) == "number" then
if string.sub( num , 1 , 1 ) == "+" or string.sub( num , 1 , 1 ) == "-" then
bnum1.signal = string.sub( num , 1 , 1 ) ;
num = string.sub(num, 2) ;
else
bnum1.signal = "+" ;
end
num = string.gsub( num , " " , "" )
local sf = string.find( num , "e" )
if sf ~= nil then
local e = string.sub( num , sf + 1 )
num = string.sub( num , 1 , sf - 1 )
e = tonumber(e) ;
if e ~= nil and e > 0 then
e = tonumber(e) ;
else
error( "Function BigNum.change: string is not a valid number" ) ;
end
local dotpos=string.find(num..".","%.")
num = string.gsub( num , "%." , "" )
local dotshift = string.len(num)+1-dotpos
for i = 1 , e do
num = num .. "0"
end
if dotshift>0 then num = string.sub(num,1,-dotshift-1) end
else
sf = string.find( num , "%." ) ;
if sf ~= nil then
num = string.sub( num , 1 , sf - 1 ) ;
end
end
l = string.len( num ) ;
oldLen = bnum1.len ;
if (l > RADIX_LEN) then
local mod = l-( math.floor( l / RADIX_LEN ) * RADIX_LEN ) ;
for i = 1 , l-mod, RADIX_LEN do
bnum1[j] = tonumber( string.sub( num, -( i + RADIX_LEN - 1 ) , -i ) );
--Check if string dosn't represents a number
if bnum1[j] == nil then
error( "Function BigNum.change: string is not a valid number" ) ;
bnum1.len = 0 ;
return 1 ;
end
j = j + 1 ;
len = len + 1 ;
end
if (mod ~= 0) then
bnum1[j] = tonumber( string.sub( num , 1 , mod ) ) ;
bnum1.len = len + 1 ;
else
bnum1.len = len ;
end
for i = bnum1.len - 1 , 1 , -1 do
if bnum1[i] == 0 then
bnum1[i] = nil ;
bnum1.len = bnum1.len - 1 ;
else
break ;
end
end
else
bnum1[j] = tonumber( num ) ;
bnum1.len = 1 ;
end
else
error( "Function BigNum.change: parameter error, type unexpected" ) ;
end
if oldLen ~= nil then
for i = bnum1.len , oldLen do
bnum1[i] = nil ;
end
end
return 0 ;
end
function BigNum.put( bnum , int , pos )
if bnum == nil then
error("Function BigNum.put: parameter nil") ;
end
local i = 0 ;
for i = 0 , pos - 1 do
bnum[i] = 0 ;
end
bnum[pos] = int ;
for i = pos + 1 , bnum.len do
bnum[i] = nil ;
end
bnum.len = pos ;
return 0 ;
end
function printraw( bnum )
local i = 0 ;
if bnum == nil then
error( "Function printraw: parameter nil" ) ;
end
while 1 == 1 do
if bnum[i] == nil then
io.write( " len "..bnum.len ) ;
if i ~= bnum.len then
io.write( " ERROR! " ) ;
end
io.write( "\n" ) ;
return 0 ;
end
io.write( "r"..bnum[i] ) ;
i = i + 1 ;
end
end
function max( int1 , int2 )
if int1 > int2 then
return int1 ;
else
return int2 ;
end
end
function decr( bnum1 )
local temp = {} ;
temp = BigNum.new( "1" ) ;
BigNum.sub( bnum1 , temp , bnum1 ) ;
return 0 ;
end
---------------------------------------------
g.setbase(2)
g.setpos("0","0")
local false_literal = false
local true_literal = true
local bnParsec = BigNum.new("45097156992")
local bnParsecHalf = BigNum.mt.half(bnParsec)
local bnParsecQuarter = BigNum.mt.half(bnParsecHalf)
local bnAeon=bnParsec -- /c
local bnAeonHalf = bnParsecHalf --/c (c=1)
local bnTwoAeons=bnAeon+bnAeon -- maybe I have to implement multiplication and division:)
local bnFourAeons=bnTwoAeons+bnTwoAeons -- -"-
local startGen = g.getgen()
local bnZero = BigNum.new(0)
local currentAeon = 0
local bnCurrentAeonBase = bnZero
local bnCurrentOffset
local nrGliderGPSECollisionsToShow = 10 -- 26 is maximum displayed, whatever bigger will be interrupted (there are 28 bits in total)
local lastfstep=11
while startGen>bnCurrentAeonBase + bnAeonHalf do
bnCurrentAeonBase = bnCurrentAeonBase + bnAeon
currentAeon = currentAeon + 1
end
local startAeon = currentAeon
g.autoupdate(true_literal)
local function smoothmag(imag, fmag)
while imag ~= fmag do
if imag < fmag then
imag = imag + 1
else
imag = imag - 1
end
g.setmag(imag)
g.sleep(200)
end
return imag
end
local function run_for_to(n, targetAeon, targetgen, istep, fstep, mags, note)
local bnTargetGen
local bnN
local magindex
local enterAeon = currentAeon
fstep = fstep or 11
if targetAeon~=nil then
if targetAeon+0>100 then
targetAeon = nil
end
end
if (targetgen ~= nil) and targetAeon ~= nil then
bnTargetGen = BigNum.new(targetgen)
if targetAeon<currentAeon then
-- g.note(showtext.." - target Aeon smaller than current one ")
return
end
while currentAeon < targetAeon do
bnCurrentAeonBase = bnCurrentAeonBase + bnAeon
currentAeon = currentAeon + 1
end
end
if (targetgen == nil or targetAeon==nil) and (n == nil) then
g.note(showtext.." - run_for_to with unknown duration")
return
end
bnCurrentOffset=BigNum.new(g.getgen()) - bnCurrentAeonBase
local bnStartGen=startGen - bnCurrentAeonBase
local bnEnterGen=bnCurrentOffset
if n ~= nil then
bnN = BigNum.new(n)
end
if (targetgen ~= nil) and (targetAeon~=nil) and (n ~= nil) then
if bnN+bnEnterGen ~= bnTargetGen then
if bnStartGen > bnTargetGen then return end -- skipping milestones to restart
if bnStartGen + bnN < bnTargetGen then -- must be script error
if bnN+bnEnterGen > bnTargetGen+BigNum.new(2^lastfstep) then
g.note(showtext.."("..currentAeon..") : - run_for_to for not matching to "..BigNum.mt.tostring(bnEnterGen).." + "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnTargetGen))
return
end
end
--g.note(showtext.."("..currentAeon..") : "..BigNum.mt.tostring(bnGen).." + "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnTargetGen).." running to first milestone after restart")
bnN = bnTargetGen - bnEnterGen
end
end
if (n==nil) then -- helper for editting at the end
bnN = bnTargetGen - bnEnterGen
--g.note(showtext.." : "..BigNum.mt.tostring(bnGen).." + "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnTargetGen))
end
if (targetgen == nil or targetAeon == nil) then -- helper for editting
bnTargetGen = bnN + bnEnterGen
while bnTargetGen>bnAeonHalf do
bnCurrentAeonBase = bnCurrentAeonBase + bnAeon
currentAeon = currentAeon + 1
bnTargetGen = bnTargetGen - bnAeon
bnEnterGen = bnEnterGen - bnAeon
end
g.setclipstr('run_for_to("'..BigNum.mt.tostring(bnN)..'", '..currentAeon..', "'..BigNum.mt.tostring(bnTargetGen)..'"')
g.note(showtext.."("..currentAeon..") : "..BigNum.mt.tostring(bnEnterGen).." + "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnTargetGen))
end
local bnGen
local sTargetGen = BigNum.mt.tostring(bnTargetGen)
if bnN<=0 then return end
local nn=BigNum.mt.tostring(bnN)
istep = istep or math.min(30, math.floor(math.log(nn)/math.log(2))-6)
local cstep = g.getstep()
if cstep<fstep then cstep = fstep end
if cstep>istep then cstep = istep end
if mags then
magindex = 1
currmag = mags[magindex]
g.setmag(currmag)
magindex = magindex + 1
end
local bn3Eistep = BigNum.new(3*2^istep)
g.setstep(cstep)
while bnN > bnZero do
g.show(showtext.."("..currentAeon..") : "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnTargetGen).." i"..istep.." f"..fstep)
while (istep > fstep) and (bnN < bn3Eistep) do
istep = istep - 2
if istep < 0 then istep = 0 end
bn3Eistep = BigNum.new(3*2^istep)
cstep = istep
if mags and magindex <= #mags then
currmag = smoothmag(currmag, mags[magindex])
magindex = magindex + 1
end
g.setstep(cstep)
end
g.step()
bnGen=BigNum.new(g.getgen()) - bnCurrentAeonBase
bnN = bnTargetGen - bnGen
cstep = g.getstep()
if (cstep<istep) then -- owerwriting manual slowdown
cstep = cstep+1
g.setstep(cstep)
end
if (cstep>istep) then -- owerwriting manual speedup
cstep = cstep-1
g.setstep(cstep)
end
end
lastfstep = fstep
if (n==nil) and (enterAeon==currentAeon) then
-- no explicit duration when Aeon boundary is crossed
bnN=bnGen-bnEnterGen
g.setclipstr('run_for_to("'..BigNum.mt.tostring(bnN)..'", '..currentAeon..', "'..BigNum.mt.tostring(bnTargetGen)..'"')
g.note(showtext.."("..currentAeon..") : ".." final generation: "..BigNum.mt.tostring(bnEnterGen).." + "..BigNum.mt.tostring(bnN).."->"..BigNum.mt.tostring(bnGen))
end
if note~=nil then
g.note(note)
end
end
local function run_from_to(bnN, targetAeon, bnTargetGen, istep, fstep, mags)
--bnTargetgen big number not nil (bnN==nil if to new Aeon)
if bnN==nil then
--g.note("T:"..BigNum.mt.tostring(bnTargetGen).." D:nil")
run_for_to(nil, targetAeon, BigNum.mt.tostring(bnTargetGen), istep, fstep, mags)
else
local bnDuration = bnTargetGen - bnN
--g.note("T:"..BigNum.mt.tostring(bnTargetGen).." D:"..BigNum.mt.tostring(bnDuration))
run_for_to(BigNum.mt.tostring(bnDuration), targetAeon, BigNum.mt.tostring(bnTargetGen), istep, fstep, mags)
end
end
local function distance_bits(prevTime)
-- somehow when interrupted, restart skips to "remaining bits read"
-- ... I should check why it happens, but it is method how to speed the show up,
-- so it looks like desired feature.
local bngcCollisionPos = bnParsecQuarter+0
local bngcCollisionTime = -bnAeon-bnTwoAeons
local collisionAeon=10 -- 3rd collision only
local bnReadTime = -bnTwoAeons
local gnPrevTime = BigNum.new(prevTime)
local bngcCollisionTimeOffs
local bnReadTimeOffs
local i
-- 12-8 12-4 12-2 12-1 12-0.5
-- 12-6 12-3 12-1.5 12-0.75
for i=3,nrGliderGPSECollisionsToShow,1 do
bngcCollisionPos=BigNum.mt.half(bngcCollisionPos)
bngcCollisionTime=BigNum.mt.half(bngcCollisionTime)
bnReadTime=BigNum.mt.half(bnReadTime)
if bnReadTime>-22000 then
-- remaining bits should be processed extra
break
end
bngcCollisionTimeOffs=bngcCollisionTime+bnAeon
bnReadTimeOffs=bnReadTime+bnAeon
if i==3 then -- Aeon exception
bngcCollisionTimeOffs=bngcCollisionTimeOffs+bnAeon
end
g.setpos(BigNum.mt.tostring(bngcCollisionPos), BigNum.mt.tostring(bngcCollisionPos))
showtext="Fast-forwarding to FSE glider with GPSE collision nr. "..i
run_from_to(gnPrevTime, collisionAeon, bngcCollisionTimeOffs+2048, 30, 0, {-30,-27,-24,-21,-18,-16,-14,-12,-10,-8,-6,-4,-2,0})
gnPrevTime=bngcCollisionTimeOffs+4096
run_for_to("2048", collisionAeon, gnPrevTime, nil, 0, {0})
g.setpos(0, 0)
showtext="Fast-forwarding to distance bit read nr. "..i
if i==3 then
gnPrevTime=nil
collisionAeon=11
end
run_from_to(gnPrevTime, collisionAeon, bnReadTimeOffs+2048, 30, 0, {-30, -2})
showtext="Note the gliders going from the center ..."
gnPrevTime=bnReadTimeOffs+4128
run_for_to(2080, collisionAeon, gnPrevTime, nil, 0, {0})
end
end
showtext="Startng crash FSE"
g.setpos(BigNum.mt.tostring(bnParsec), BigNum.mt.tostring(bnParsec))
run_for_to("1024",0,"1024",4,4,{-1})
showtext="Startng crash FNW"
g.setpos(BigNum.mt.tostring(-bnParsec), BigNum.mt.tostring(-bnParsec))
run_for_to("1024",0,"2048",4,4,{-1})
showtext="Fast-forwarding to first collision of gliders from GPSEs..."
g.setpos(0,0)
run_for_to(nil, 4, "960", 30, 6, {-30,-27,-24,-21,-18,-16,-14,-12,-10,-8,-6,-4,-2,0})
showtext="Note the gliders going from the center..."
run_for_to("992", 4, "1952", 4, 4, {0})
g.setpos(BigNum.mt.tostring(bnParsecHalf), BigNum.mt.tostring(bnParsecHalf))
showtext="Fast-forwarding to first FSW glider with GPSE collision..."
run_for_to(nil, 6, "448", 30, 2, {-30,-27,-24,-21,-18,-16,-14,-12,-10,-8,-6,-4,-2,0})
run_for_to("2048", 6, "2496")
g.setpos(0, 0)
showtext="Fast-forwarding to first distance bit read ..."
run_for_to(nil,8,"1280",30, 6, {-2})
showtext="Note the gliders going from the center ..."
run_for_to("1024", 8, "2304", 4, 4, {0})
g.setpos(BigNum.mt.tostring(bnParsecQuarter), BigNum.mt.tostring(bnParsecQuarter))
showtext="Fast-forwarding to second FSE glider with GPSE collision..."
run_for_to(nil, 9, "1184", 30,2,{-30,-27,-24,-21,-18,-16, -14, -12, -10, -8, -6, -4, -2, 0})
run_for_to("2048", 9, "3232")
g.setpos(0, 0)
showtext="Fast-forwarding to second distance bit read ..."
run_for_to(nil,10, "-1088", 30, 6, {-2})
showtext="Note the gliders going from the center ..."
run_for_to("2048", 10, "3168", 4, 4, {0})
showtext="Fast-forwarding to first inserted MWSS bits ... here only 28 bits are encoded in pattern size"
run_for_to("194952", 10, "198120", nil, 4, {-24, -16, -8, -4, -2, 0})
showtext="Each inserted bit reduces pattern dimensions to half, there will be no chance to wait for result without the reduction"
run_for_to("1600", 10, "199720", nil, nil, {0})
showtextbase="Transform the initial crash site into a usable blinker elbow"
showtext=showtextbase
showtextbase="Building LWSS seed and blocks"
showtext=showtextbase
run_for_to("16449536",10,"16649256",nil,nil,nil,nil)
showtext=showtextbase.." - Creating block needed for ECCA construction and another one to construct a GPSE stopper"
run_for_to("21102592",10,"37751848",nil,nil,nil,nil)
showtext=showtextbase.." - LWSS seed construction started"
run_for_to("33882112",10,"71633960",nil,nil,nil,nil)
showtext=showtextbase.." - LWSS seed construction ended, stackbottom repositioning starts"
run_for_to("125435904",10,"197069864",nil,nil,{0,-3},nil)
g.setpos("600", "-600")
showtext=showtextbase.." - Stackbottom repositioning ended"
run_for_to("838074368",10,"1035144232",nil,nil,nil,nil)
showtextbase="Building glider seed"
showtext=showtextbase
g.setpos("1200", "-1200")
showtext=showtextbase.." - Creating target block for glider seed"
showtext=showtextbase.." - Start of glider seed recipe"
run_for_to("16580608",10,"1051724840",nil,nil,nil,nil)
showtext=showtextbase.." - End of glider seed recipe"
run_for_to("80740352",10,"1132465192",nil,nil,nil,nil)
showtext=showtextbase.." - Switch to stack items better for long fills"
run_for_to("2228224",10,"1134693416",nil,nil,{0,-2},nil)
g.setpos("600", "-1400")
showtextbase="Creating synced glider pair to invoke the seeds to create distant target"
showtext=showtextbase
showtext=showtextbase.." - Creating long gap on the stack"
showtext=showtextbase.." - You may notice the last 3 pairs of beehive pairs differ from he rest"
run_for_to("35782656",10,"1170476072",nil,nil,nil,nil)
showtext=showtextbase.." - Expensive transformation to standard stack items ended"
run_for_to("10616832",10,"1181092904",nil,nil,nil,nil)
showtext=showtextbase.." - Target for the subrecipe created, glider pair seed recipe starts"
run_for_to("12845056",10,"1193937960",nil,nil,nil,nil)
showtext=showtextbase.." - Glider pair seed recipe ended"
run_for_to("101842944",10,"1295780904",nil,nil,nil,nil)
showtextbase="Distant target creation seed activation"
showtext=showtextbase
run_for_to("3407872",10,"1299188776",nil,nil,nil,nil)
showtextbase="Distant target creation seed activated"
showtext=showtextbase
run_for_to("65536",10,"1299254312",nil,nil,nil,nil)
showtext=showtextbase.." - Stack have to return to the position to build DBCA"
run_for_to("1638400",10,"1300892712",nil,nil,nil,nil)
showtext=showtextbase.." - Stack returned to the position to build DBCA"
run_for_to("3145728",10,"1304038440",nil,nil,nil,nil)
showtextbase="(Green) DBCA building recipe applied to the distant target, including cordership activation seed, the most expensive part of the RCT15 constant part "
showtext=showtextbase
showtext=showtextbase.." - (Green) DBCA sleeping pattern is ready, we have to replace the stack by reflector targets to ignite the corderships"
run_for_to("24649596928",11,"-19143521624",nil,nil,nil,nil)
showtextbase="Building 2 target blinkers for DBCA reflectors, 1 target blinker for ECCA reflectors and glider to activate the cordership"
showtext=showtextbase
run_for_to("10682368",11,"-19132839256",nil,nil,nil,nil)
showtext=showtextbase.." - Big move of stack bottom to ECCA target starts. It uses easily destroyable filler."
showtext=showtextbase.." - Expensive part converting stack top to blinker."
run_for_to("20578304",11,"-19112260952",nil,nil,nil,nil)
showtext=showtextbase.." - Filler removal."
run_for_to("11141120",11,"-19101119832",nil,nil,nil,nil)
showtext=showtextbase.." - Gap separating ECCA reflector target from 1st DBCA reflector target was created"
run_for_to("10354688",11,"-19090765144",nil,nil,nil,nil)
showtext=showtextbase.." - Gap separating 1st DBCA reflector target from 2nd DBCA reflector target was created"
run_for_to("6029312",11,"-19084735832",nil,nil,nil,nil)
showtext=showtextbase.." - Gap separating glider construction stack from the reflector targets created"
run_for_to("6881280",11,"-19077854552",nil,nil,nil,nil)
showtextbase="Activating the cordership to start DBCA reflectors"
showtext=showtextbase
run_for_to("13303808",11,"-19064550744",nil,nil,nil,nil)
showtextbase="DBCA reflectors activated"
showtext=showtextbase
run_for_to("65536",11,"-19064485208",nil,nil,nil,nil)
showtextbase="remnants of the original arm removed, green DBCA activated"
showtext=showtextbase
run_for_to("589824",11,"-19063895384",nil,nil,nil,nil)
showtextbase="Creating eater at the Green line and White target using Green DBCA"
showtext=showtextbase
showtextbase="Green portion of DBCA really finished, White portion construction begins"
showtext=showtextbase
run_for_to("18874368",11,"-19045021016",nil,nil,nil,nil)
showtextbase="Decoder and better construction arm (DBCA) finished"
showtext=showtextbase
run_for_to("536936448",11,"-18508084568",nil,nil,{-2,-3},nil)
showtext=showtextbase.." - Half of 1044 gliders absorber finished"
run_for_to("15925248",11,"-18492159320",nil,nil,nil,nil)
showtext=showtextbase.." - cleanup of the PI explosion from the initial GPSE collision starts"
g.setpos("0", "0")
showtext=showtextbase.." - cleanup of the PI explosion from the initial GPSE collision ended,"
run_for_to("34996224",11,"-18457163096",nil,nil,nil,nil)
showtext=showtextbase.." - GPSE stopping block positioned"
run_for_to("5701632",11,"-18451461464",nil,nil,nil,nil)
showtextbase="Releasing first glider FSE"
showtext=showtextbase
run_for_to("7995392",11,"-18443466072",nil,nil,nil,nil)
showtext=showtextbase.." - Releasing second glider FSE"
run_for_to("4325376",11,"-18439140696",nil,nil,nil,nil)
showtextbase="Releasing third glider FSE"
showtext=showtextbase
run_for_to("4325376",11,"-18434815320",nil,nil,nil,nil)
showtext=showtextbase.." - Target for ECCA construction and SW switching circuitry ready"
run_for_to("1835008",11,"-18432980312",nil,nil,nil,nil)
showtextbase="Creating ECCA (Fake ... just inc4)"
showtext=showtextbase
showtext=showtextbase.." - East p256 gun started"
run_for_to("2193489920",11,"-16239490392",nil,nil,nil,'debug East p256 start, replace whole ECCA by rct16\\pslmakeTargets\\ECCA_Replacement.mc (central position)')
showtext=showtextbase.." - West p256 gun started"
run_for_to("23789568",11,"-16215700824",nil,nil,nil,nil)
showtextbase="Fake ECCA (replaced) started"
showtext=showtextbase
run_for_to("65536",11,"-16215635288",nil,nil,nil,nil)
showtext=showtextbase.." - Switch FSE"
g.setpos("0", "0")
showtext=showtextbase.." - Switch FSE ready"
run_for_to("197197824",11,"-16018437464",nil,nil,{0,0},nil)
g.setpos("0", "0")
showtextbase="Switched FSE"
showtext=showtextbase
run_for_to("3473408",11,"-16014964056",nil,nil,{0,-4},nil)
g.setpos("500", "-500")
showtextbase="Corderabsorbers program ends, 1045 gliders absorber is away so stopping the DBCA"
showtext=showtextbase
run_for_to("1441136640",11,"-14573827416",nil,nil,nil,nil)
showtext=showtextbase.." - signal 2 way cleaned, the bit later destroying the ECCA sent"
run_for_to("196608",11,"-14573630808",nil,nil,nil,nil)
showtext=showtextbase.." - First glider arrived to FSE"
run_for_to("176518792704",15,"-18443466072",nil,nil,nil,nil)
g.setpos("45097156992", "45097156992")
showtext=showtextbase.." - Second glider arrived to FSE"
run_for_to("4325376",15,"-18439140696",nil,nil,nil,nil)
showtext=showtextbase.." - Third glider arrived to FSE"
run_for_to("4325376",15,"-18434815320",nil,nil,nil,nil)
showtext=showtextbase.." - Switched FSE"
run_for_to("2419851264",15,"-16014964056",nil,nil,{-4,-2},nil)
g.setpos("45097157492", "45097156492")
showtextbase="FSE Cleanup"
showtext=showtextbase
run_for_to("65536",15,"-16014898520",nil,nil,{-2,-1},nil)
g.setpos("45097156992", "45097156992")
showtextbase="FSE Cleanup finished"
showtext=showtextbase
run_for_to("24969216",15,"-15989929304",nil,nil,nil,nil)
g.setpos("45097156992", "45097156992")
showtextbase="Building FSE ECCA reflectors"
showtext=showtextbase
g.setpos("45097157092", "45097156892")
showtextbase="FSE ECCA reflectors finished"
showtext=showtextbase
run_for_to("603586560",15,"-15386342744",nil,nil,{-2,-2},nil)
g.setpos("45097157092", "45097156892")
showtextbase="FSE corderabsorbers ready"
showtext=showtextbase
run_for_to("812580864",15,"-14573761880",nil,nil,nil,nil)
showtext=showtextbase.." - reflecting 3rd bit, half of the signal will cause destroying ECCA"
run_for_to("129024",15,"-14573632856",nil,nil,nil,nil)
showtextbase="green ECCA program starts"
showtext=showtextbase
run_for_to("180388498688",19,"-14573762136",nil,nil,{-2,-2},nil)
g.setpos("0", "0")
showtext=showtextbase.." - first data signal reflected to destroy FSE reflectors"
run_for_to("131072",19,"-14573631064",nil,nil,nil,nil)
showtextbase="yellow glider hit to clean the boat bit"
showtext=showtextbase
run_for_to("20971520",19,"-14552659544",nil,nil,nil,'debug hitting yellow glider, comment the glider out (in ECCALevels_13_DBCADestroyal.txt) if not needed')
g.setpos("0", "-2000")
showtext=showtextbase.." - Hitting DBCA block 1/3 on the way to stop the reset line"
run_for_to("4063232",19,"-14548596312",nil,nil,nil,nil)
g.setpos("0", "-2000")
showtext=showtextbase.." - DBCA reset line stopped"
run_for_to("786432",19,"-14547809880",nil,nil,nil,nil)
showtext=showtextbase.." - DBCA S p256 stopped"
run_for_to("11075584",19,"-14536734296",nil,nil,nil,'debug the glider line')
showtext=showtextbase.." - DBCA N p256 stopped"
run_for_to("4259840",19,"-14532474456",nil,nil,nil,'debug the glider line')
showtext=showtextbase.." - signal destroying FSE reflectors arrives and is reflected back to ECCA"
run_for_to("180347467518",23,"-14573634906",nil,nil,nil,'debug time offset')
g.setpos("45097156992", "45097156992")
showtext=showtextbase.." - signal destroying ECCA arrived"
run_for_to("180388615682",27,"-14573647192",nil,nil,nil,'debug seed of destroyal time_offset?')
g.setpos("0", "0")
showtextbase="And this is end so far"
showtext=showtextbase
run_for_to("206323712",27,"-14367323480",nil,nil,nil,'work in progress,\n Note that this scripts allow you restart at any generation.\n You can stop it, watch a detail and restart afterwards to let show continue.')
The current version is not in calcymans github yet. In future I would add watching GPSE signal collisions, but it would just waste time during debugging. I am testing DBCA destroyal and White ECCA build. I am waiting for fast enough comp to compute full green ECCA recipe. It seems the White ECCA portion would be fine with tub with tail "insertor" so the ECCA target for destroyal seed is confirmed. ... but after the DBCA destroyal and WhiteBuild we would have exact final position with incomming destroyal signal. Hmmm DBCA destroyal tests detected wrong relative position of the FSE reflectors (should be 32FD more distant) ... .
OK, DBCA destroyal program debugged till the destruction of the CMOS pair, where I have computed destroyal for the wrong state of the DBCA.
DBCA ends with color WHITE (the leaking one) glider emitted ... so I have to recompute the destroyal line program....
I could probably force the final DBCA semistate without increasing the DBCA bit program length. What I do not maintain in the DBCA semistate is the boat bit at the end of the yellow line (at time multiples of 2^9).
It would be nice to be able to chose the DBCA program with the boat bit cleaned at the time of the destroyal. Hmm, seems the boat bit at time multiples of 2^9 is periodic determined by the length of DBCA program mod 24 (depending on the initial semistate).
(non data signal flips the bit twice, moves and fire do not flip the bit, only fake does the changes, color change flips the bit independently on the color, phase flip changes the bit depending on the phase (if the flip occurs)). As the starting semistate is fixed only the length of the program matters. As both the final color and phase is fixed, with the fixed (optimal for the given line phase pattern) length of the program the boat bit is determined. Prolonging the bit program by 12 would allow the same color and phase glider emission with the flip of boat bit. Destroying the potential boat bit by the ECCA costs at most 7 bits, so we neednot worry about the DBCA program optimization regarding the bit. Uff.
Hmm, prolonging the DBCA program by 12 bits would generate another semistate for "semiflipping the phase", so we should have separate versions for the pattern with boat and pattern without the boat (with changed state of just one semisnark). After the ECCA building program would be incorporated, we will choose the approprioate version.
Parity of number of emited gliders determines if the final semistate cycle is 0,5,2,7 (even) or 1,4,3,6 (odd).
Last glider color and phase requires state 0 or 4 at emission time, so after the emission the state would be 1 or 5 and after reset the states will be 4 or 2. This means color CMOS pair would be the same, but the remaining semisnarks have two of four options. The optimal length of the recipe determines the existence of the boat bit (additional 4*3 bits would mean the same semistate, but opposite boat state).
Flipping the existence of the boat bit before stopping first p256 requires just one ECCA glider during the arm block positioning.
So we just need two destroyal programs depending on the final state 4 resp. 2 depending on the parity of DBCA emited gliders.
If we manage to modify some recipe without increasing its cost to change the parity of the number of gliders, we could always choose the "better" final state.