Skip to content

Conformed to Java conventions and updated GridLocation directory. #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/main/java/chapter09/gridlocation/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@

import info.gridworld.grid.Location;

public class Main
{
public static void main(String[] args)
{
System.out.println("The distance between the two points is: " + Distance(new Location(9, 2), new Location(2, 2)));
public class Main {
public static void main(String[] args) {
System.out.println("The distance between the two points is: " + distance(new Location(9, 2), new Location(2, 2)));
}

public static int Distance(Location loc1, Location loc2)
{
public static int distance(Location loc1, Location loc2) {
int location1Row = loc1.getRow();
int location1Column = loc1.getCol();
int location2Row = loc2.getRow();
Expand Down