Okay, so I have two methods, one to save selected arrow keys to a text file, and the other to load them as integers. Here's the first:
Code:
public void saveKeys()
{
String out = Integer.toString(left)+"\n"+Integer.toString(right)+"\n"+Integer.toString(up)+"\n"+Integer.toString(down)+"\n";
try
{
PrintWriter save = new PrintWriter("key_selection.txt",out);
The only place where division occurs is in line 23, and the only way you can divide by zero is if there is no difference between cy and ey, meaning the shape is a line, which I would not do within the parameters of this program. Although perhaps your confusion is related to that fact that I somehow forgot a certain line of code:
I am trying to write a program to create boundaries for a polygon on a two-dimensional coordinate plane. Here is my code:
Code:
public class Example {
public Example()
{
for (int y = 0; y < game1.o.l; y++)
{
System.out.println("( "+game1.o.bind[0][y]+", "+game1.o.bind[1][y]+" ) -> ( "+game1.o.bind[2][y]+", "+game1.o.bind[3][y]+"
Leave a comment: