• 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!

combining reals

Pfap

Member
[SOLVED]

I'm pulling values from a grid and then pushing them onto a stack to be pulled from later. I have 6 values and I'm trying to figure out if there's a way to combine them to form a pattern?

a = 1
b = 2
c = 3

pattern = a+b+c

I want to somehow end up with 123 and not 6.

Or maybe a different data structure would be a better choice?
I'm using the grid to draw my objects in there positions and the stack to keep track of where they are.

create event:
a = grid_index[# 0, 0]
b = grid_index[# 1,0]
c = grid_index[# 1,0]

stack = ds_stack_create()

alarm event1:
ds_stack_push(stack,a)

alarm event2:

ds_stack_push(stack,b)

alarm event3:

ds_stack_push(stack,b)


step event:

pattern = a+b+c


Any suggestions?
 
Last edited:
D

dannyjenn

Guest
If a, b, and c are all single-digit integers then you could do
pattern = a*100 + b*10 + c
 
Top