msoe.edu > OP > Instructions

OP 2024 Computer Competition Instructions

by Dr. Robert Hasker
contributions by Drs. D. Rothe, E. Durant, H. Welch, and C. Tritt
Friday 22 November 2024

Contents


Setting Up Your Laptop

MSOE Laptops

  1. Click on the "Sign in" button on the welcome screen. No password is needed.
  2. Laptops have been configured to access wireless network "MSOE-Guest". Ensure you are connected to this network.

Note: Occasionally, the laptop may ask if you want to download and install various updates. You should always decline these prompts.

Team-Supplied Laptops

Connect to the Wi-Fi network "MSOE-Guest." No password is needed. Teams in the ITC will receive Wi-Fi directions there.

Note: All file locations discussed in these instructions are recommendations, not requirements. You may set up the projects and files in any fashion you choose. The contents of the laptop are not visible to the judges. Only the source files that you submit via the scoring website will be used for evaluation.

Using Intellij for Java Projects

  1. Double-click the IntelliJ icon on the desktop.
  2. In the Welcome panel, click on New Project in the upper right.
  3. Ensure Java is selected (but not Groovy) and click Next.
  4. Select Create project from template and click Next to crate a Command Line App.
  5. Set the project name to practice. When working on problems, you will use prob1, prob2, etc. For the project location, browse to a convenient folder such as your Documents folder. Set the Base package to your team name (without any spaces).
  6. Click Finish
  7. Enter System.out.println("Hello"); where IntelliJ has "// write your code here".
  8. Important: the class and file will be named Main.java. You must change this so judges know what problem is being solved. Right click on the class name (right after public class), select Refactor and then Rename..., and rename the Main class to Practice. For solutions to problems, use the names Problem1, Problem2, etc. Doing this will also change the filename, which is good since the judge will use that to know which problem is being solved.
  9. Click on any of the green arrows to run your program. You will see a console output window with your text on it. If prompted, select Run 'Main'.
  10. Modify and re-run the program until it is adequately tested and works on all cases.
  11. Select Save All from the File menu.
  12. Follow the instructions at Submitting Programs for Judging to submit your solution.

Note that the laptops have PyCharm installed. Talk to a student helper if you would like to use this platform.

IntelliJ Notes

Using Eclipse for Java Projects

  1. Double-click the Eclipse icon on the desktop.
  2. The "Workspace Launcher" should prompt you for a workspace. If it doesn't, select "File|Switch Workspace|Other..."
  3. Browse to "C:\EclipseWorkspace" if it is not already selected. Click OK.
  4. Select File | New | Java Project...
  5. For the "Project name," enter "probN" (e.g., "prob1", "prob7").
  6. In the JRE box, select "Use default JRE 'jdk-13.0.1' and workspace compiler preferences.
  7. Under "Project Layout" select "Use project folder as root for sources and class files."
  8. Select "Finish".
  9. If you don't see the Package Explorer (usually the left pane), select the arrow in the upper right corner of the Eclipse Welcome Screen to move to the Workbench.
  10. Click on your new project and ensure it is selected in the Package Explorer.
  11. Select File | New | Class.
  12. Enter "ProbN" for the name.
  13. Select the check-box that indicates a public static void main stub is to be generated.
  14. Click "Finish".
  15. Enter your Java program, which will start in the main method.
  16. When you are ready to test your program, select Run | Run As | Java Application n(Alt-Shift-X followed by J) or press Ctrl-F11.
  17. Select "OK" to save your work.
  18. Your program runs and the output is shown in the Console tab.
  19. If necessary, edit your program and try again.
  20. When you are satisfied, right-click the top-level probN icon in the Package Explorer and select Close Project.
  21. Follow the instructions at Submitting Programs for Judging to submit your solution. Note, if you followed the instructions above, the Java source file for you to submit will be located at C:\EclipseWorkspace\[project name]\[project name]\[class name].java.

Eclipse Notes

Using BlueJ for Java Projects

BlueJ is provided for teams that prefer it.

  1. Double-click the BlueJ icon on the desktop.
  2. Project | New Project...
  3. Enter "C:\BlueJProjects\" in the Location name field.
  4. Enter probN (e.g., "prob3") in the Name field.
  5. Click "OK"
  6. Click New Class...
  7. Enter "ProbN" for the name.
  8. Click "OK".
  9. Double-click the "probN" block icon. This will open an edit window for your program.
  10. Enter your Java program. Make sure there is a public static void main(String[] args) method, since that is where the judge will start your program.
  11. When you are ready to test your program, click "Compile"
  12. Continue to click "Compile" in the Class window fixing errors until you compile without errors. Close the class editor when finished.
  13. To run program, right-click on the block icon in the project screen. Select void main(String[] args) from the menu. Click "Ok" to specify no arguments. A console window will appear with your program's output and will accept your keyboard input.
  14. When you are satisfied, select Project | Close
  15. Follow the instructions at Submitting Programs for Judging to submit your solution. Note, if you followed these instructions, your source file will be located at C:\BlueJProjects\[project name]\[class name].java. This is the file to submit for judging.
  16. Begin working on another problem (step 2).

Using Java from the Command Line

The Java command line compiler and JVM are available for those who prefer that environment.

  1. Double-click the Notepad++ icon on the desktop. Notepad++ is a good text editor for Java code.
  2. Notepad++ will start with a new blank file. Select File | Save As and navigate to C:\JavaCode and save the file with a name such as ProbN.java where N is the problem you are working on.
  3. Enter your Java program. Make sure there is a main method, since that is where the judge will start your program.
  4. When you are ready to test your program, save the file. You may close Notepad++ or leave it open.
  5. Click the "cmd" (Command Prompt) icon on the taskbar.
  6. Change directory to C:\JavaCode.
  7. Compile the program by running the compiler - javac ProbN.java.
  8. If errors are found, fix errors by editing source file. If no errors are found, run the program by invoking the JVM - java ProbN (no extension) at the command prompt.
  9. Follow the instructions at Submitting Programs for Judging to submit your solution. Your source file will be located at C:\JavaCode\[class name].java. This is the file to submit for judging.
  10. Begin working on another problem (step 1).

Using Microsoft Visual Studio (MSVS) C++ Projects

  1. Click on the Microsoft Visual Studio 2017 icon on the taskbar.
    • If the icon is not available, browse to and launch the IDE executable: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common 7\IDE\devenv.exe This will show as an "Application." Do not select devenv.exe.config, which shows as "XML Configuration File."
  2. If prompted to sign in, select "Not now, maybe later."
  3. Select File | New Project...
  4. Select Visual C++ | Windows Console Application as the project type.
  5. The project location should be defaulted to C:\VisualStudioProjects If necessary, select this directory.
  6. In "Name", enter the project name, which should be "probN" (e.g., "prob1", "prob7").
  7. Check Place solution and project in the same directory.
  8. Click "OK"
  9. Enter your program in the window that appears. Do not remove #include "stdafx.h"
  10. Press Ctrl+Shift+B (Build | Build Solution) to build your project.
  11. Press Ctrl+F5 (Debug | Start Without Debugging) to run your program normally. (You are welcome to try the debugger.)
  12. When you are ready for your program to be judged, select "File | Close Solution".
  13. Follow the instructions at Submitting Programs for Judging to submit your solution. If you followed these instructions, the file you should submit will be located at C:\VisualStudioProjects\[project name]\[project name]\[source name].cpp.
  14. Go to step 3 to get started on the next problem.

To switch to another, existing project, select "File | Recent Projects". If the project you are looking for isn't there, use "File | Open | Project" and locate the desired project on your C:\ drive.

Minimal example program

#include <iostream>
using namespace std;

int main() {
     cout << "Hello, World!" << endl;
     return 0;
}
(Note: if your version of Visual Studio generates files with #include <stdafx.h> in them, then leave that line in your program.)

Using Anaconda for Python Projects

  1. Use Notepad++ or another text editor to edit your Python source code
  2. Save your Python code in C:\PythonCode\. It is recommended that you use filenames like prob5.py.
  3. Run "Anaconda Prompt" using either the taskbar icon or by searching on the Start menu.
  4. cd \PythonCode
  5. Run you code: e.g., python prob5.py
  6. If your leading whitespace is a mixture of tabs and spaces, you may violate Python formatting rules. In Notepad++, select Edit|Blank Operations|Tab to Space or Space to Tab (Leading) to clean up your file's formatting.
  7. Follow the instructions at Submitting Programs for Judging to submit your solution.

Finding Data Files

Some of the programming problems in this competition may require data files. These files should be present in the folder specified below in order to be found when the program runs. All required files will be available from this link. When you click a particular file on this page, if your browser displays the file rather than opening the download dialog, then go Back to the data page, right-click the file name and select the Save link [or target] as...option. Complete the Save as dialog box to save the file in the project folder and click Save to save the file. Data files must be used exactly as they are provided and/or described in the problem statement. You may not add or remove lines or reformat the contents of these files in any way. These files will be used in this same format for evaluating your program. DO NOT cut and paste the files from the browser window; use the Save link feature to ensure that you get the entire file in its proper form.

Where to store your data files

Note: All file locations discussed in these instructions are recommendations, not requirements. You may set up the projects and files in any fashion you choose. The contents of the laptop are not visible to the judges. Only the source files that you submit via the scoring website will be used for evaluation.

Take care with file extensions

When saving a data file, Windows sometimes adds an extra extension. For example, input.txt actually gets saved as input.txt.txt, making it hard for your program to find the file it needs. If your computer isn't configured to show these extensions, do the following.

Submitting Programs for Judging

Using the competition management website

NOTE: You will not be able to submit solutions until the contest starts. But read through these directions so that you can submit when the time comes.
  1. Visit http://134.122.2.238/.
  2. Click on New User.
  3. Enter the Username you received when you registered. Note this is different than your school name. Pick a reasonably good password: two randomly chosen words work well. Click Set Password Make sure you write the password somewhere safe! It can be reset, but it will take time.
    You may get a warning about an unsecure connection. A future version will add more security, but there are protections in the system against common exploits.
  4. You can click on the Standings tab to view standings across all teams.
  5. To submit, click on the Home tab and click on the small error at the right end of the box for the problem you wish to submit.
    New this year: there is a practice tool built into the submittal system. Click on the Hello World problem and submit a trivial source file. The language is not important - judges will not see these solutions. Click on the Submit button; the system will respond with an "incorrect solution" message. This is to show you the appearance of an incorrect solution message. Resubmit, and this time the system will automatically mark your solution as correct. NOTE: this is the only place where the system responds automatically. The real solutions are judged by hand and any response is entered manually.
  6. During the contest, when you have a solution to a problem you will repeat the above for that problem, clicking on choose File to select the source code file (e.g., prob1.java) to submit from your C:\ drive.
  7. Click on the green Submit button.
  8. Once it is scored, you will see a small red circle if it failed or a green checkbox if it passed. You can click on the arrow to view the feedback.
  9. You may see a small white box at the top of the screen next to the Annoucements tab. This indicates a new announcement; browse to the Announcements tab to view it.

You can resubmit solutions, but note that you lose points for each incorrect solution you submit. Let a student worker know if you have additional questions about why a submission was incorrect.