Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Using a calculation to place locations

by kcott (Chancellor)
on May 07, 2013 at 14:16 UTC ( #1032489=note: print w/replies, xml ) Need Help??

in reply to Using a calculation to place locations

G'day Hasharray,

Welcome to the monastery.

This technique appears to do what you want.

$ perl -Mstrict -Mwarnings -e ' my $X_initial = "80"; my $Y_initial = "80"; my $MAX_X = 240; my ($cur_x, $cur_y) = ($X_initial, $Y_initial); for (0 .. 20) { if ($cur_x > $MAX_X) { $cur_x = $X_initial; $cur_y += $Y_initial; print "\n"; } print " \t$_:$cur_x/$cur_y"; $cur_x += $X_initial; } print "\n"; ' 0:80/80 1:160/80 2:240/80 3:80/160 4:160/160 5:240/160 6:80/240 7:160/240 8:240/240 9:80/320 10:160/320 11:240/320 12:80/400 13:160/400 14:240/400 15:80/480 16:160/480 17:240/480 18:80/560 19:160/560 20:240/560

I'll leave you to translate that into your XML-populating code.

-- Ken

Replies are listed 'Best First'.
Re^2: Using a calculation to place locations
by Hasharray (Novice) on May 07, 2013 at 17:50 UTC
    Dude! You rock! Thanks a mill, really appreciate it!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032489]
[Eily]: hello people \o/
[karlgoethebier]: manpages..
[Eily]: and non-people and NodeReaper
[Discipulus]: you so kid to greet non people..;=)
Discipulus kind not kid..
[Corion]: The bots bow in response
[Discipulus]: so karlgoethebier, what this idiom is and where i can read about it? i tried to deparse and gives error..;=(
[karlgoethebier]: Eily: non-people == persone non grata?
[Your Mother]: Corion: I have lost the link to the pmdev guide(s). Do you have that handy?
[karlgoethebier]: Discipulus: see per lop please how to avoid the classic <c>perl 'rm -rfv *|'</>

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-07-21 08:07 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (319 votes). Check out past polls.