https://github.com/solunarnexus/cnc-code-utility
Simple command line tool for solving the assigned problem: sorting blocks of code and searching for maximum and minimum value inside input textfile.
https://github.com/solunarnexus/cnc-code-utility
assignment-solutions command-line-tool python
Last synced: 9 days ago
JSON representation
Simple command line tool for solving the assigned problem: sorting blocks of code and searching for maximum and minimum value inside input textfile.
- Host: GitHub
- URL: https://github.com/solunarnexus/cnc-code-utility
- Owner: SolunarNexus
- Created: 2021-10-18T19:53:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-13T08:49:39.000Z (almost 3 years ago)
- Last Synced: 2025-03-02T19:17:54.240Z (over 1 year ago)
- Topics: assignment-solutions, command-line-tool, python
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CNC utility tool
This is a resulting command line tool to solve the following assignments.
The tool accepts one argument, `-fun1` or `-fun2`, and one input file that is a CNC program code.
Example of use:
>py script -fun1 D327971_fc1.i
The main objectives were:
- ### Objective 1.
For each coordinate, add a constant (10) to every Y where X is greater than 50
- ### Objective 2.
Each code block begins with the CNC machine definition *(e.g., T01, T02,...)*, and ends on line just before
the following machine definition. Code blocks are mixed, and the objective is to sort them by machine
definition number in ascending order.
- ### Objective 3.
Find and print maximum and minimum values for the X and Y axes in the `x_min/x_max/y_min/y_max` format.
## Command line arguments:
- **-fun1** takes the input file, performs objectives 1 and 2, and writes modified file content into a new file, `cnc.txt`.
- **-fun2** takes the input file, performs objective 3, and writes the result to the standard output.