3D Puzzle Assignment #1 Programming Language, Spring 2003.

Slides:



Advertisements
Similar presentations
An Introduction to Programming By :- Vishal Hirani B.Tech II year (CSE)
Advertisements

Lecture 5.
Week 4 – Functions Introduction. Functions: Purpose Breaking a large problem into a series of smaller problems is a common problem- solving technique.
IT151: Introduction to Programming
CS201 – Makefile Tutorial. A Trivial Makefile # Trivial Makefile for puzzle1.c # Ray S. Babcock, CS201, MSU-Bozeman # 1/5/05 # puzzle1: puzzle1.c gcc.
Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional.
C Programming Language 4 Developed in 1972 by Dennis Ritchie at AT&T Bell Laboratories 4 Used to rewrite the UNIX operating system 4 Widely used on UNIX.
Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-
CS-502 Fall 2006Project 1, Fork1 Programming Project 1 – Fork.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
Kakuro Puzzles game Chang-Yin Lin CS491B December
Lecture 9: SHELL PROGRAMMING (continued) Creating shell scripts!
CSCI/CMPE 4341 Topic: Programming in Python Chapter 3: Control Structures (Part 1) – Exercises 1 Xiang Lian The University of Texas – Pan American Edinburg,
Shell Programming 1. Understanding Unix shell programming language: A. It has features of high-level languages. B. Convenient to do the programming. C.
Consecutive Numbers Algebra I.
2 $ command Command Line Options ls –a –l hello hi Command Arguments.
SOLVING SUDOKU WITH MATLAB VERIFICATION FUNCTION correctness verification of the puzzle: checks if the current element appears twice in the same line,
Agenda Control Flow Statements Purpose test statement if / elif / else Statements for loops while vs. until statements case statement break vs. continue.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Introduction to Computational Linguistics Programming I.
Using Matrices A matrix is a rectangular array that can help us to streamline the solving of a system of equations The order of this matrix is 2 × 3 If.
CNG 140 C Programming Lecture Notes 2 Processing and Interactive Input Spring 2007.
Getting Started: Ansoft HFSS 8.0
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Lexical Analysis I Specifying Tokens Lecture 2 CS 4318/5531 Spring 2010 Apan Qasem Texas State University *some slides adopted from Cooper and Torczon.
LPDS MTA SZTAKI Equation Solver Light A Grid solution.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
1. Exam Topics Difference between computers and calculators John creates a new device. It will compute the orbit of all the planets in the solar system.
ORDER OF CONTENT AND INSTRUCTIONS A program in its simplest form usually contains three kinds of activity:  INPUT : The program asks the user for some.
Cube Assignment #2 Programming Language, Spring 2003.
COSC 235: Programming and Problem Solving Ch. 2: Your first programs!!! Instructor: Dr. X.
Getting Started with MATLAB (part2) 1. Basic Data manipulation 2. Basic Data Understanding 1. The Binary System 2. The ASCII Table 3. Creating Good Variables.
8-2 What is a program? What is a “Window Manager” ? What is a “GUI” ? How do you navigate the Unix directory tree? What is a wildcard? Readings: See CCSO’s.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
Lecture 5 1.What is a variable 2.What types of information are stored in a variable 3.Getting user input from the keyboard 1.
Warm Up A ___________________ is a letter used to represent an unknown. Evaluate the expression
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Input and Output.
 Software Development Life Cycle  Software Development Tools  High Level Programming:  Structures  Algorithms  Iteration  Pseudocode  Order of.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
1 An Introduction to R © 2009 Dan Nettleton. 2 Preliminaries Throughout these slides, red text indicates text that is typed at the R prompt or text that.
Introduction to Programming
Arrays. Topics to be Covered... Arrays ◦ Declaration ◦ Assigning values ◦ Array manipulation using loops Multi-dimensional arrays ◦ 2D arrays ◦ Declaration.
Data Structure and Algorithm: CIT231 Lecture 3: Arrays and ADT DeSiaMore DeSiaMorewww.desiamore.com/ifm1.
Homework 4 Basic Blocks and Control Flow Graphs CS4430 Spring 2012 Due: April 2 nd by 2pm* * There will be absolutely no extensions for this assignment.
Dale Roberts Introduction to Java - Input, Program Control and Instantiation Dale Roberts, Lecturer Computer Science, IUPUI
For loop. Exercise 1 Write a program to have the user input three (3) numbers: (f)rom, (t)o, and (i)ncrement. Count from f to t in increments of i, inclusive.
1 Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
Island of Logic Assignment #4 Programming Language, Spring 2003.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Linux Administration Working with the BASH Shell.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
Gaussian Elimination and Gauss-Jordan Elimination
Programming what is C++
The Inverse of a Square Matrix
Consecutive Numbers Algebra I.
Sit-In Lab 1 Ob-CHESS-ion
2.1- Solving Equations Graphically
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
1. Open Visual Studio 2008.
Programming Funamental slides
Programming Assignment #5
CS Software Studio Assignment 1
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
POS 408 Week 1 Individual Assignment Individual: Console Display Message//tutorfortune.com Click on below link to buy
On your whiteboards: Write
Assignment #3 Programming Language, Spring 2003
Presentation transcript:

3D Puzzle Assignment #1 Programming Language, Spring 2003

3D Puzzle Characteristics –Consist of 4 ⅹ 4 ⅹ 4 frame –Contains 63 small cells of equal size 1 empty position that was the same size as a small cell A unique number of integer was printed on each small cell –Empty position is marked with ‘$’

Making out a Puzzle Puzzle –Solving a puzzle Make the frame display the numbers in order –Operation Small cell can be moved into empty position If it were immediately to the right, to the left, in the front, in the rear, above, or below the empty position

Assignment Objectives –Slide cells into the empty position so that the frame displays the numbers in order Requirements –Input initial puzzle from file –Show current frame status Can slide cell into the empty position –by command line input –by sliding-sequence file Can output complete solution of sliding-sequence into file

Input Convention Command –Sliding operations 1 : The square above the empty position moves 2 : The square below the empty position moves 3 : The square to the left of the empty position moves 4 : The square to the right of the empty position moves 5 : The square in the front of the empty position moves 6 : The square in the rear of the empty position moves

Source Code puzzle.c –Input initial puzzle file Get file name by program argument $>./puzzle puzzle.in –Show current frame status Command line input –Input ‘1~6’ command to slide cell File input –Input ‘1~6’ command from sliding-sequence file –Each line contains maximum 10 command Output complete solution –Output complete sliding-sequence solution into file –puzzle.out

Initial Puzzle puzzle.in –4 ⅹ 4 ⅹ 4 matrix Consist of 1 st, 2 nd, 3 rd,and 4 th planes(4 ⅹ 4 matrix) Total 16 lines –Example $ …

Input Command Command Line –Input sliding command –1~6 Input sequence file name –$>in [filename] Output sequence file name –$>out [filename] –Example $>1 $>6 $>in seq.in $>out seq.out $>3

Sliding-Sequence File In File –Contain lines of cell sliding-sequence Each line contains maximum 10 operations –Example …

Output Puzzle Command Line –Current puzzle status Consist of 1 st, 2 nd, 3 rd,and 4 th planes(4 ⅹ 4 matrix) Example – | | | – | | | – | | | –13 $ | | |

Spec. Assignment Spec. –System Unix (junebug.snu.ac.kr) –Language C/C++ –Compile Use Makefile $>make –Execution $>./puzzle puzzle.in