Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def drawGrid(draw: Shape => Unit) {
- var y_spacing = 0
- var x_spacing = 0
- val numLines = G_SIZE / G_INTERVAL
- def makeLn(axis: Char) {
- val aLine = axis match {
- case 'y' =>
- y_spacing += G_INTERVAL
- makeLine(y_spacing, 0, y_spacing, G_SIZE)
- case 'x' =>
- x_spacing += G_INTERVAL
- makeLine(0,x_spacing, G_SIZE, x_spacing)
- }
- draw(aLine)
- }
- (1 to numLines).foreach(_ => makeLn('y'))
- (1 to numLines).foreach(_ => makeLn('x'))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement