KittyTac wrote:Useful Notes
Main
DarthWiki
More
Create New
//Javascript code to calculate arrays via recursive formula
//Can handle cases where no starting numbers are required or used
//Able to handle an arbitrarily large amount of starting numbers
//"n_m" is the "m" most recent number added to the array
//Format: sampi([first term, second term, etc.],'formula', length of output array)
function sampi()
{var n = (eval(arguments[0]));//just in case no starting number was input, evaluate before starting array
var recursiveoutput = [n];
var i;var k=0//initializing variables used in loops
var recursionformula =(arguments[(arguments.length -2)])//store the formula, it'll likely need changing
recursionformula=recursionformula.replace(/(-)+/g,'+-1*')//allow subtraction of recursive variables
for(i = 1; i < (arguments.length -2); i++)//for each of the starting numbers
{n = (arguments[i]);
recursiveoutput.push(n)}//build the start of the array, one step at a time
for(i = (arguments.length-2); i < (arguments[(arguments.length -1)]); i++)
//start of the recursion formula checker, doesn't overwrite starting numbers or go past output length
{if (recursionformula.match(/(n_)(\d)+/g) === null) {var newrecursionformula=recursionformula}
//can't replace something that doesn't exist
else {var q=recursionformula.match(/(n_)(\d)+/g).map(function(z)
//look for numbers defined by recursion
{return z.replace(z,(recursiveoutput[(recursiveoutput.length)-z.match (/\d/)]))})
//get numbers based on outputs and/or starting numbers
let k=0
var newrecursionformula=(recursionformula.replace(/(n_)(\d)+/g,function()
{return q[k++]}))}//set the recursively defined numbers to their current values
n = eval(newrecursionformula)//calculate the next number in the array
recursiveoutput.push(n)}//put number in and move to next step
if (arguments[(arguments.length -1)] < recursiveoutput.length) {recursiveoutput.pop()}
//should only apply if there are exactly two arguments, unless bad code was evaluated
return(recursiveoutput)}//the output and final result
//Unless someone else came up with this first, no rights reserved.
KittyTac wrote:5404372234566543456765432345687564327893045867543263745896857463523647586985473625435678985746354673478439849383479434937889658473625346789
This number was never typed by a human before!
KittyTac wrote:Code: Select allhigh res images that appear huge
KittyTac wrote:KittyCat is taken everywhere. KittyTac usually isn't. Also, those images are .svg discord emojis.
main.c:1:15: warning: __VA_ARGS__ can only appear in the expansion of a C99 variadic macro
#define macro(__VA_ARGS__, ...) __VA_ARGS__
^
main.c:1:28: error: duplicate macro parameter "__VA_ARGS__"
#define macro(__VA_ARGS__, ...) __VA_ARGS__
^~~
x = 3, y = 3, rule = B26/S2|B358/S3
2o$2bo$obo!
x = 236, y = 236, rule = Life
13bo211bo$14bo208b2o$12b3o209b2o$228bo$9bo218bobo$4bo5b2o206bobo7b2o$
5bo3b2o3bobo201b2o$3b3o9b2o202bo5bo$15bo208bo$9bo214b3o2bobo$obo4bobo
210bo8b2o$b2o5b2o5bo204bobo7bo$bo14b2o202b2o11bo$11bo3b2o216bobo$12bo
216bo3b2o$5bo4b3o209bobo2b2o$6b2o214b2o4b2o$5b2o216bo100$117b2o$117b2o
100$12bo216b2o$6b2o4b2o214b2o$7b2o2bobo209b3o4bo$b2o3bo216bo$obo216b2o
3bo$2bo11b2o202b2o14bo$5bo7bobo204bo5b2o5b2o$5b2o8bo210bobo4bobo$4bobo
2b3o214bo$11bo208bo$10bo5bo202b2o9b3o$16b2o201bobo3b2o3bo$6b2o7bobo
206b2o5bo$5bobo218bo$7bo$10b2o209b3o$11b2o208bo$10bo211bo!
[[ AUTOSTART X -100 Y -100 GPS 40 STEP 4 ZOOM 6 NOREPORT T 399 X 0 Y 0 PAUSE 1 "*record scratch*" PAUSE 2 "Yup. That's me." PAUSE 5 "You're probably wondering how\nI got into this situation." ]]
x = 12, y = 14, rule = B3457/S4568
4bo2bo$4b4o$2b8o$2b2ob2ob2o$obobo2bobobo$2ob6ob2o$ob3o2b3obo$3ob4ob3o$
2ob6ob2o$b3o4b3o$b3o4b3o$3b2o2b2o$3bo4bo$5b2o!
x = 33, y = 36, rule = B3/S23
12b2o2b3ob3ob3obobo$12bobobobobo3bo3bobo$12bobobobobobobobo2bo$12bobob
obobobobobo2bo$12b2o2b3ob3ob3o2bo2$12b2o2b3ob3o$12bobobobobo$12bobobob
obobo$12bobobobobobo$3bob2o5b2o2b3ob3o$3b2obo$12bobobobobob3ob2o2bo$
12bobobobobo2bo2bobobo$12bobobob3o2bo2b2o2bo$12bobobobobo2bo2bobobo$
13bobo2bobob3obobob3o10$8b2o$2o6b2o$2o3$13b2o$13b2o$4b2o$3bobo$4bo!
x = 26, y = 31, rule = B36/S23
16b2o$16b2o5$5b2o2b3ob3ob3obobo$5bobobobobo3bo3bobo$5bobobobobobobobo
2bo$5bobobobobobobobo2bo$5b2o2b3ob3ob3o2bo2$5b2o2b3ob3o$2o3bobobobobo$
2o3bobobobobobo$5bobobobobobo$5b2o2b3ob3o2$5bo3bobobob3ob2o2bo$5bo3bob
obo2bo2bobobo$5bobobob3o2bo2b2o2bo$5bobobobobo2bo2bobobo$6bobo2bobob3o
bobob3o5$11bo$11b3o$14bo$13b2o!
x = 39, y = 18, rule = B3/S2-i34q
37b2o$2o2b3ob3ob3obobo18b2o$obobobobo3bo3bobo$obobobobobobobo2bo$obobo
bobobobobo2bo$2o2b3ob3ob3o2bo2$2o2b3ob3o$obobobobo$obobobobobo$obobobo
bobo$2o2b3ob3o2$o3bobobob3ob2o2bo$obobobobo2bo2bobobo$obobob3o2bo2b2o
2bo$obobobobo2bo2bobobo$bobo2bobob3obobob3o!
x = 34, y = 44, rule = B2ck3ajnr4rw5jy6kn/S01c2aik3cjn4eiknw5ajqry6cek7e
25bo3$11bo4$27bo11$13b2o2b3ob3ob3obobo$13bobobobobo3bo3bobo$13bobobobo
bobobobo2bo$13bobobobobobobobo2bo$13b2o2b3ob3ob3o2bo2$13b2o2b3ob3o$13b
obobobobo$13bobobobobobo$13bobobobobobo$13b2o2b3ob3o$6bo$13bobobobobob
3ob2o2bo$13bobobobobo2bo2bobobo$13bobobob3o2bo2b2o2bo$13bobobobobo2bo
2bobobo$14bobo2bobob3obobob3o3$o2$17bo3$12bo$26bo!
KittyTac wrote:We need a "CGoL Facts" bot on Discord.
!dyk
cvojan wrote:Cool factoid:
This is the slowest orthogonal spaceship discovered.
77topaz wrote:cvojan wrote:Cool factoid:
This is the slowest orthogonal spaceship discovered.
In a two-state outer-totalistic Life-like cellular automaton, that is. Far slower spaceships exist in multi-state rules.
x = 17, y = 10, rule = B3/S23
b2ob2obo5b2o$11b4obo$2bob3o2bo2b3o$bo3b2o4b2o$o2bo2bob2o3b4o$bob2obo5b
o2b2o$2b2o4bobo2b3o$bo3b5ob2obobo$2bo5bob2o$4bob2o2bobobo!
cvojan wrote:Cool factoid:
This is the slowest orthogonal spaceship discovered.
Just take a look for yourselves:Code: Select allx = 12, y = 14, rule = B3457/S4568
4bo2bo$4b4o$2b8o$2b2ob2ob2o$obobo2bobobo$2ob6ob2o$ob3o2b3obo$3ob4ob3o$
2ob6ob2o$b3o4b3o$b3o4b3o$3b2o2b2o$3bo4bo$5b2o!
Users browsing this forum: No registered users and 1 guest