• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

I'm not aware of a single line for this in gml, or ruby... do you?

shandor

Member
it's a rng based on physical space... I have an accomidation I just enauthored, that uses SIGMA :) or do you mean, what was the inspiration? I have no clue. I had a thought and wrote it down...

GML:
function sigma (n, p)
{
    for (var i = 0; i < p; i ++) {
        var result = n + p
    }
    return result
}
you know, a delta and a sigma, p(e) are the original formulas I know for this branch of code. bryansray is my seeder of coordinates/shaders/pixels... basically I'm told to not really solve it for anyone but myself, but I thought I would share the C I have on my machine from last night's sleepless wandering of C, C++ and C# :)

oops, I rewrote it in ruby...

Ruby:
def sigma_rec (n, p, i)
    {
        var result = n + p, i ++: return unless i == p
        sigma_rec(n,p,i)
    }
you know, I realized it's solution in one line, but it requires some more knowledge of this engine. and I'm told I need a break to refresh in the outdoors, maybe a walk or some neighbor interactions.
 
Last edited:

Nidoking

Member
function sigma (n, p) { for (var i = 0; i < p; i ++) { var result = n + p } return result }
Is this a competition to find the least efficient way to implement addition? A for loop is a nice thought, but it really needs at least one non-tail-recursive call and a few leaked data structures. It's also probably worth throwing in some actual complicated operations rather than just adding n+p p times.
 

chamaeleon

Member
just adding n+p p times.
To be fair, it is more complex than that. If p is less than or equal to 0, you get a runtime error due to an undefined variable. I'd hesitate to just perform an addition, just in case that is an intended feature.
 

shandor

Member
for now it is, I'll write a proper one later. I used to dev for 12 hours straight, not really allowed to anymore. what is O time of recursion, ln(n+?) compared to a for loops, n+,? the omega complexity even shows recursions easier,? a for loop say, n = 231 million has r.t. on this device at 33.1 seconds, a tail recursion stacked that much would in fact give a run time error on GML? that's a bummer. in ruby and C it's not that bad, but a few nanoseconds.. C.S nerds <3

replacing n with a culon would allow a function n to repeat p times as p in limits, and i as the set var. I was just toying with things. I noticed unity and gml lack a sigma functionality...

I nearly have this bryan's ray figured in C# on unity, was just seeing the field of engines.. It's for a generated world/plane/existence
 

shandor

Member
true... :)

GML:
result = clamp(round(221.3 + bnc() div player_pos),0.1,221321) if player_pos == last_pos
this is my fin result, it resolves between 231, and 250 respectfully :) joy. an rng... bnc is an unknown certainty that results in wierdo ness known as n-k-321..123..000..1 this is my range for the work anyway, respectfully...

Code:
function bnc()
{
    var rnd = 321765123 div (current_time + 1) % 20; return rnd
}
an nyg is a nuuget of information known as cryan which is cyan to us... meaning if I reuse bnc, I can get hex. but in the afforementioned, it's a single plot. I need some rest to brain throuhg a 2 quad output system. I really just want to render a flat noise planar.
 

shandor

Member
Depends on what you're doing with the recursion (how many recursive calls performed per call of itself). One recursive call, perhaps implementing the equivalent of a for loop, would yield the same complexity, O(n).
yes indeed :)

please allow this bump...

bnc() = seed_of_entropy div (adder_to_nth + min) % range_of_results; return

that's all. I wanted to use player position for this, to see what a terrain noise'r would do in 3d...

I'm on break for now<3
 

shandor

Member
ahhh :) this one does some things, but i ended up binding it differently...

GML:
function bnc_empty()
{
    var rnd = 321765123 div (time) % 256; return rnd
}

function rng(i,n)
{
    random_n = bnc_empty()
  
    return (random_n % power(n,i)) + 4
}
rng returns a nice 1-.10 for a call of, [png(2,2)] it grows slowly... :) oops quick note
bryans ray was written on parchment firstly, and had another set of impossible expressions...
this one works better.

please allow this one :) Indiana Grd on Twitter: "I rewrote bryans ray in gml, ruby was eh, I could use it, but no, I needed a variable way of coloring a sphere... It was originally working as a shader between distances, but check this one out :) #what, #bryansray https://t.co/y9WX7IuDrs" / Twitter
 
Last edited:
Top