//I have picture(148x148) and i cuted it to (32x32) and it icon_state = (1,1);(1,2)... to (4,4)
#define DEBUG
turf/icon='turf.dmi'
obj
Grid
icon='Charizard.dmi'
var/screen_x
var/screen_y
Click()
world<<src.screen_loc
mob
Login()
src.loc=locate(1,1,1)
verb/GeneratePicture()
set background=1
var/list/x_list=list(1,2,3,4)
var/list/y_list=list(1,2,3,4)
var/X;var/Y
for(var/Column = 1 to 4) for(var/Row = 1 to 4)
var/obj/Grid/G = new
G.screen_loc = "[Row],[Column]"
G.screen_x=Row
G.screen_y=Column
G.icon_state= "[Column],[Row]"
src.client.screen += G
sleep(1)
/////////////
var/counter=0
for(var/obj/Grid/G in src.client.screen)
if(counter==4)
x_list=list(1,2,3,4)
y_list=list(1,2,3,4)
counter=0
X=pick(x_list)
G.screen_x=X
Y=pick(y_list)
G.screen_y=Y
G.screen_loc = "[G.screen_x],[G.screen_y]"
x_list.Remove(X)
y_list.Remove(Y)
counter++
world<<"[G.screen_x],[G.screen_y]"
Problem description:
Hi I have torrible with this code. I wanna create system to create picture from little pieces. I know how to create full picture but I have no idea how to set random screen_loc for them.
1) It strikes me that you don't in fact mean "random". You have a specific place in mind, do you not?
2) Your screen_loc in the column/row loops is wrong; it's column first, row second.
3) What the heck is that last loop supposed to do?