Coder Social home page Coder Social logo

coding_challenge's Introduction

Coding_Challenge

The program simulates the creation of subdirectories (folders) for an OS. The input file to your program, input.dat, will contain a sequence of commands that a user might enter from a command line, and the output file file.out will contain the operating system’s responses to these commands.

Usage

"Usage: python console.py [command file] > [output file]"

Sample input

dir
mkdir sub6
mkdir sub3
mkdir sub4
dir
mkdir sub4
cd sub3
cd sub3
mkdir sub3
mkdir sub6
mkdir sub4
dir
cd sub6
dir
cd sub6
mkdir sub666
dir
up
up
dir
up

Sample Output

Directory Problem by Mike
Command: dir
Directory of root:
No subdirectories
Command: mkdir sub6
Command: mkdir sub3
Command: mkdir sub4
Command: dir
Directory of root:
sub3 sub4 sub6
Command: mkdir sub4
Subdirectory already exists
Command: cd sub3
Subdirectory does not exist
Command: cd sub3
Command: mkdir sub3
Command: mkdir sub6
Command: mkdir sub4
Command: dir
Directory of root\sub3:
sub3 sub4 sub6
Command: cd sub6
Subdirectory does not exist
Command: dir
Directory of root\sub3\sub6:
No subdirectories
Command: cd sub6
Command: mkdir sub666
Command: dir
Directory of root\sub3\sub6:
sub666
Command: up
Command: up
Command: dir
Directory of root:
sub3 sub4 sub6
Command: up
Cannot move up from root directory
End of Directory Problem by Mike

Things I didn't get to:

  • Adding StdIn input
  • More error handling with more verbose outputs
  • Automated tests
  • Not using print for output. Wanted to write into file but didn't have time to switch.

coding_challenge's People

Contributors

acylicsalmon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.