Cube - PowerPoint PPT Presentation

About This Presentation
Title:

Cube

Description:

3 by 3 by 3 cube built of 27 smaller cubes ... Substrings representing the front, middle and back plane. Substrings representing the top, middle and bottom row ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 9
Provided by: samz
Category:
Tags: cube

less

Transcript and Presenter's Notes

Title: Cube


1
Cube
  • Assignment 2
  • Programming Language, Spring 2003

2
Cube
  • Cube
  • 3 by 3 by 3 cube built of 27 smaller cubes
  • Cube is fallen apart into 7 pieces
  • 7 pieces can be assembled in many ways to again
    form the cube

3
Assembled Cube
  • Representation
  • Linearized form string
  • Substrings representing the front, middle and
    back plane
  • Substrings representing the top, middle and
    bottom row
  • Substrings representing the left, middle and
    right cell
  • Example
  • adcaccaacddgbfgffedggbfebee
  • aababbadcffegfcddcfeeggedgc

4
Assignment
  • Objectives
  • Computes all possibilities of assembling the cube
  • But suppress solutions that are mere rotations of
    another solution
  • Choose only one from the possibilities

5
Source Code
  • cube.java
  • Input file
  • Get input name by program argument
  • gtjava cube cube.in
  • Output
  • All possibilities of assembling the cube
  • Output file name
  • cube.out

6
Input
  • cube.in
  • Contains
  • Number of pieces of the cube
  • Lines with symbol and linearized form of each
    piece
  • Example
  • 7
  • aaaaa00000000000000000000000
  • bbb0b00000000000000000000000
  • cccc0c0000000000000000000000
  • ddd00dd000000000000000000000
  • eee0e00000e00000000000000000
  • fff0f00000000f00000000000000
  • ggg0g000000g0000000000000000

7
Output
  • cube.out
  • All possibilities of assembling the cube
  • Suppress solutions that are mere rotations of
    another
  • Choose only one from the possibilities
  • Output string is a linearized form of the cube
  • Example
  • aaaabbcdbeffcggcddeefegfcgd
  • aaaabbcdbeggcgfcddeegeffcfd
  • aaaabbcdbggecdfcdfgeegdecff
  • ...

8
Spec.
  • Assignment Spec.
  • System
  • Unix (junebug.snu.ac.kr)
  • Language
  • Java
  • Compile
  • Use Makefile
  • gtmake
  • Execution
  • gtjava cube cube.in
  • Test
  • gt./test
Write a Comment
User Comments (0)
About PowerShow.com