Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Java Break Out

Name: javally challanged 2006-10-23 19:00

Hey i'm coding a java version of Break Out for one of my classes.   What my teacher put out was a set of JUnit tests that i have to write code to make the tests pass.  I am having a problem with getting one of the tests to pass.  this is the test i am having problems with:
public void testOverlapsWholeBottom()
    {
        BoundingBox b1 = new BoundingBox(new Rectangle(3, 3, 5, 5));
        BoundingBox b2 = new BoundingBox(new Rectangle(3, 8, 5, 5));
        assertTrue(b1.overlaps(b2));
        assertTrue(b2.overlaps(b1));
    }

and this is the code i have witten to check for overlaps of boxes:

public boolean overlaps(BoundingBox otherBox) { 
    if (this.space.intersects(otherBox.space)){
            return true;
        }
       
            //return true;
        return false;
    }

the test is trying to detect if the bottom line of a box is sharing the same line as the the box below them.  also my teacher said that i would need to move one rectangle up one unit, i would really appreciate it if anyone knows how to do this.

Name: Anonymous 2006-10-23 20:21

lol you're coding in Java

Name: javally challanged 2006-10-23 20:45

haha i know... but its what my teacher makes us work with, any helpful tips??

Name: Anonymous 2006-10-23 22:30

I hope you fail. The world needs fewer shitty programmers.

Name: Anonymous 2006-10-24 5:58 (sage)

I made a breakout for java once, it used no trig and plenty of bells and whistles. Also no sound because I didn't have enough time/patience to find out how to produce sounds trying to scour that nasty api.

Name: Anonymous 2006-10-24 6:09

FAIL

Name: Anonymous 2006-10-24 6:48

You're trying to see if the hitbox is inside the other one, right?

here's a perfectly good tutorial on it: http://www.gamedev.net/reference/articles/article735.asp

And from now on try to google those for yourself :)

Name: Anonymous 2008-02-19 10:16

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

Name: Anonymous 2008-02-19 10:17

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░  LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

Name: Anonymous 2008-02-19 10:18

More experimenting:
██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

Name: Anonymous 2008-02-19 10:19

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

██████████████████████████████████████████████████████████████████
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒░░  LISP ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓████▓▓▒▒░░ LISP  ░░▒▒▓▓██
██▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓████▓▓▒▒░░░░░░░░░░▒▒▓▓██
██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓████▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓██
██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
██████████████████████████████████████████████████████████████████

Name: Anonymous 2009-02-23 2:25

test
test
test
test
test
test
test
test

Name: Sgt.Kabu鍛彍kimanᜒ蛱 2012-05-28 20:35

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Name: Anonymous 2013-09-01 17:06


Proposed in 1931, the Zermelo's navigation problem is a classic optimal control problem. The problems deals with a boat navigating on a body of water, originating from a point O to a destination point D. The boat is capable of a certain maximum speed, and we want to derive the best possible control to reach D in the least possible time.

Name: Anonymous 2013-09-01 19:23


A set is pure if all of its members are sets, all members of its members are sets, and so on. For example, the set {{}} containing only the empty set is a nonempty pure set.

Don't change these.
Name: Email:
Entire Thread Thread List