Home
Netbeans Eclipse Qt Java
Games
College of Engineering Aeronautics and Astronautics Agricultural and Biological Engineering Biomedical Engineering Chemical Engineering Civil Engineering Construction Engineering and Management Electrical and Computer Engineering Engineering Education Engineering Professional Education Environmental and Ecological Engineering Industrial Engineering Materials Engineering Mechanical Engineering Nuclear Engineering
EPICS (Engineering Projects In Community Service) First-Year Engineering Program First-Year Engineering Honors Program Global Engineering Program Minority Engineering Program Professional Practice (Co-Op) Program Women in Engineering Program
College Administration Schools Programs All Groups All People ECN Webmail
Purdue Home

ECE 462 Fall 2010,

Group Programming Assignment

Stage 4 (C++ and Qt) Networking, GUI, and Competiton

Summary

You need to write a program that can solve the Rubik's Cube using as few commands as possible. Your program must communicate to a referee program that determines whether your program successfully solves the Cube. Your program also needs to show the state changes based on the commands.

Requirements

This stage requires the following functions:

  • Communicate with a referee program. This referee will give a state for your program to solve. The referee will also specify the allowed commands. Your program will send back the sequence of commands.
  • Display the commands and visually show the state after each command.
  • Find a solution from the state given by the referee program. The solution should use as few commands as possible.

This stage needs much more effort than the previous stages. You must start early.

The details for each requirement is given below.

Grading (5 points)

Networking (1.5 points)

Please remember that if your program cannot handle networking, you will not receive any point for the display or the solution part.

Your program will need to connect to the server program provided (by connecting to a given port number and IP address).  It will then need to abide by the network protocol specified in the presentation given in class (updated form available here).

EDIT: New command added to the server not mentioned in the pdf above:  the competition server will give time updates at about two minute intervals (with additional updates at about 9 min and about 9 min 30 sec) to warn you how much time has passed.  These messages will be given at in the form "TIME:(time in seconds)".  Your program does not need utilize them, they are there if you wish to use them, but they should not break your program.

The most recent version of the competition server can be found here.

Display (1.5 points)

Your team needs to write a C++ program that contains

  • two text boxes to input the server IP address and port number
  • a button to connect to the server
  • a 3-D view of the cube
  • a 2-D view of the cube
  • a text area that shows the sequence of commands used to solve the cube
  • a text area that shows the states after executing each of the command in the sequence. Neither text area allows a user to input anything. In other words, the text areas are for output only.
  • a label to display whether the program won or lost at the the end of the competition.

When a command is displayed, the 3-D and the 2-D views should show the correct state. The command is appended to the end of the first text area and the cube's state is added to a new line in the second text area.  There should then be a half second pause before the next command is displayed to allow for the change in state to be noticeable.

After each test, the views should return to the initial state (as shown in GPA2). The contents in the two text areas are cleared.

Solution (2 points)

Your score is determined by comparing the number of commands to solve the cube and the number of commands used to create a state from the initial state. The referee program will give a state that is generated by applying at least one turn command and at most 20 turn and rotation commands.  Suppose n commands are used to generate a state and your program needs m commands to solve. You will receive

  • 100% if m < 2 n
  • 75% if 2 n <= m < 3 n
  • 50% if 3 n <= m < 4 n
  • 25% if 4 n <= m < 6 n
  • 0 if m >= 6n

The referee will check up to 5n commands from your program and ignore any additional commands. It is possible that m < n. For example, if a state is produced by applying FFF to the initial state. Your program can solve it by a single F command, instead of three commands F'F'F'.

To ensure that your program produces a solution timely, your program can spend at most 10 minutes in execution.  If your program takes more than 10 minutes, it is considered failing to find a solution. 

By comparing your solution with the number of commands used to generate a state, your score does not depend on the quality of solutions from the other teams.

Competition

Your team must receive at least 80% in the solution part to qualify.

A competition will be held to compare the solutions from different teams. The team that requires the fewest commands to solve a cube wins. Each match starts with the same state that is produced by applying at least 8 and at most 25 turn and rotation commands.

  • champion: 5 bonus points to every team member
  • second place: 3 bonus points
  • third place: 1 bonus point

If there is a tie after three matches, both teams will receive the same amounts of bonus points. It is possible, even though unlikely, to have multi-way ties; for example, four teams all solve a cube using exactly n commands.