-
Posts
2 -
Joined
-
Last visited
Posts posted by johnnyfortune
-
-
Hello All!
I am struggling to build a script that is generating random images. I want to place a bunch of circles on a rectangular image. However I want those circles to appear in random locations.
I have been using the range($min,$max) function to keep track of "used" spaces on the X axis, based on the circle size, but I was wondering if there is a class somewhere that could simplify this.
Ideally, something that takes a given width and height, and breaks that into a group of "cells".
IDK if any of you have played the game battle ship, but something like that. Id like to be able to do placeCircle("A1");
Does anyone have any suggestions?
Thanks for reading!
JF
Coordinate Grid Mapping (Battleship)
in PHP Coding Help
Posted
Thanks for your reply. This is kinda what I came up with so far. It generates a pixel grid for X & Y coordinates.
IDK maybe someone someday will find this useful? I figured I would share. it works for what I needed.
GRID FUNCTION
SEARCH
USAGE EXAMPLE