GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Re: GML Creations » CHALLENGE: Conway's Game of Life » 2011-04-24 13:45:05

Here's my gmk: http://www.megaupload.com/?d=1GFM7AYJ. I can't wrap my mind around xot's method >.> looks...confusing.

For 'FPS Booster' which really doesn't do much, just add:

CREATE:
t=0
tt=200
set_automatic_draw(0)

STEP:
t+=1
if t>tt{t=0; screen_redraw()}else{t+=1}

#2 Re: GML Creations » CHALLENGE: Conway's Game of Life » 2011-04-20 22:17:34

Expandngen=ds_grid_create(W,H);
pgen=ds_grid_create(W,H);

gen=0

dslist=ds_list_create()

f=file_text_open_read(get_open_filename('life file|*.cells;*.txt',""))
iy=0
do{
str=file_text_read_string(f)
ix=0
repeat(string_length(str)){
if string_copy(str,ix,1)=="O"{ds_grid_set(ngen,ix+1,iy+1,1)}
ix+=1}
file_text_readln(f)
iy+=1
}until file_text_eof(f)
file_text_close(f)

If it helps, here's the pattern loader I made that loads patterns from files into ds_grids,
file is here: http://www.megaupload.com/?d=7586U982 along with my slow example. Or you can just make a .txt file of this:

Expand..................................................
..........................O.......................
........................O.O.......................
..............OO......OO............OO............
.............O...O....OO............OO............
..OO........O.....O...OO..........................
..OO........O...O.OO....O.O.......................
............O.....O.......O.......................
.............O...O................................
..............OO..................................
..................................................

I will post my entire .gmk later when its faster.

#3 Re: GML Creations » CHALLENGE: Conway's Game of Life » 2011-04-17 15:11:16

Actually the "fps booster" version only runs slower because it uses a 80x80 grid instead of 40x40. But yea I thought it was cheating. Thats why I posted the other version. Will post gmk later.

#4 Re: GML Creations » CHALLENGE: Conway's Game of Life » 2011-04-17 12:07:50

http://www.megaupload.com/?d=7586U982
Runs at around 2500 fps on my craptop. 3500 at best. 80 x 80 grid because 40 x 40 was too small for me. Goes more then 4x faster in 40x40 though.
I assure you that I'm not multiplying the fps shown, the fps is legit. Probably uses the same method as xot's "rather unfair ringer".
I put some other patterns in the zip file for your enjoyment. Snail is one of my favourites.

If you want to see 40x40 version go here http://www.megaupload.com/?d=04JQN3HS doesn't use the fps booster method of the previous. But only the gosper gun file is small enough to work in it.

#5 Re: Script Submission » get_weekday(day,month,year) » 2009-05-20 17:58:05

Woops I completely missed that one. I honestly don't even remember that command.

and for zeller's laws
http://en.wikipedia.org/wiki/Zeller's_congruence
the 'laws' are the rules you have to follow to find the correct weekday.

#6 Script Submission » get_weekday(day,month,year) » 2009-05-19 22:24:38

blopit
Replies: 2
Expand/*
get_weekday(day,month,year)

arguments:
    day
    month
    year

returns: 
    the weekday on the date indicated
    0=sunday
    1=monday
    2=tuesday

*/

yy=argument2 mod 100
c=((argument2-(argument2 mod 100))/100)
m= argument1+10 
if m>12 =false {yy-=1}else{m-=12}
return (floor(argument0+((13*m-1)/5))+yy+floor(yy/4)+floor(c/4)-(2*c))mod 7

made this while checking zeller's laws

#7 Re: Script Submission » place meeting for 3d » 2009-05-19 20:39:41

Sorry, but I believe this one wouldn't work properly if there is more than one object at  "argument0,argument1" .  I think instance_place_list(x,y,obj) could be used to your scripts benefit to check which solid's "zz+height" is closer to the player's zz. Just a suggestion.

Board footer

Powered by FluxBB