New topic: 

Coding Exercise

<http://forums.realsoftware.com/viewtopic.php?t=45658>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        Jordan          Post subject: Coding ExercisePosted: Sat Oct 20, 
2012 7:36 pm                         
Joined: Wed Jan 04, 2006 7:58 pm
Posts: 553
Location: Tri-State Area (NJ, NY, CT)                Here's a coding exercise. 
Wrote this up as something I'd like to do, but haven't gotten to yet...

However, if anyone wants to take a crack at it let me know. More than happy to 
slide a couple of duckets your way via PayPal.

Click for large view

Description: The idea is to draw x number of blocks in a x by y grid, given a 
space (boundary) of x by y, with proper spacing between columns and rows (see 
picture above)

- Method to determine appropriate size of block to draw given: boundary, number 
of blocks, top margin, bottom margin)
- Method to size and place 3 to 16 canvases within an x by x boundary/canvas
 
Parameters
 - x by x boundary (e.g. 540x360
 - number of blocks (e.g. 3 to 16 blocks)
 - top margin
 - bottom margin
 - block (canvas to be drawn)
 - size of block ( e.g. 108x67)
 
Constraints
 - minimum vmargin,hmargin = 32 <--dynamic based on size of boundary & block
 - minimum block size = 108x67 <--dynamic based on size of boundary, num of 
lines, top, bottom margins
 - mininum blocks 3, maximum blocks 16
 - maximum blocks per line = 4
 - minimum lines = 1, maximum lines = 4
 - blocks are drawn from left to right
 - all blocks are centered horizontally within boundary
 - margins between blocks are dynamically calculated and equal distant based on 
boundary, determined block size, and number of blocks      
_________________
http://www.kaliware.com
Carbon Declare Library Contributor   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to