Intended audience: Students of Algorithms and Data Structures (ADS), Aarhus University.
In ADS, you have to solve a number of programming tasks along the way. The programming tasks should be solved in Java using the BlueJ or IntelliJ programming environment.
To solve a programming task, first find the task either in Brightspace or in the tasks list of this repository. Read the task description, and start solving the task!
To upload your solution, you need three things:
- Task ID (from the task description)
- Username (
adsYY-djXXXX
, whereYY
is the current year andXXXX
is your programming group number, found on Brightspace grade) - Password (from Brightspace grade)
If you have technical problems, contact Casper Rysgaard on the Brightspace discussion board. See also the list of common mistakes.
-
Open BlueJ
-
Click "New Project..."
-
Save the new project somewhere
-
In the edit menu, select "Add Class from File..."
-
Select the skeleton Java file for the problem you're solving and the Submit.java file
-
Click "Compile" to ensure that the code you're given can compile. If it doesn't compile, write to Casper Rysgaard on the Brightspace discussion board.
-
Click
testAll()
on the task class to see that some or all of the tests currently fail -
Read the test output to see that some tests have
FAIL
written -
Open the editor on the class for this task (that is, not the Submit class, but the class named after the problem you're solving)
-
Sometimes BlueJ opens the file to a random line. If this happens, scroll up to the top, since you don't have to edit most of the methods in the given file.
-
At the top of the file, you can now start implementing the algorithm to solve the given task
-
Click Compile to see if you have any syntax or type errors to correct
-
If your code compiled successfully, you can now click
testAll()
again to see if the tests pass -
If the test output doesn't say
FAIL
anywhere, you're done! -
Right click
Submit
and choosesubmit(String taskID, String username, String password)
. Remember to put "quotes" around the three strings. Find the Task ID in the task description. -
Enter the username and password your TA gave you, and enter the ID for this task. If the task ends in
"-2"
, that means you can get 1 point for a correct solution and an additional 1 point for a fast solution. -
Your code will be submitted to the automated judge, and after a while you will see the judgement. Remember to switch to the console window of BlueJ if it doesn't appear automatically.
- Create a new java project normally.
- Add the needed files from the specific task to the src folder, along with the Submit.java file.
- Open the Submit.java file, and chance the boolean flag 'intellij' at the top to 'true'.
- To test the implementation, open the Submit.java file. In the main method at the top, add calls to the static test methods in the provided files for the task, and run the code.
- To submit the code, uncomment the line with the submit call in the main method, add the needed credentials, and run the code.
- Submitting code that calls System.out for debugging. System.out.println() is a good tool to use if you can't find out why your solution doesn't work. However, the judge gets confused if you leave in calls to System.out.println() when submitting your code, since it looks at the output of the main() method to determine if your solution is correct. Remember to comment out any System.out-lines in your own code before calling submit()!
If you believe there are other common mistakes that should be mentioned in this list, let us know on the Brightpsace discussion board.