diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-04-26 07:38:44 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-04-26 07:38:44 -0600 |
commit | aadee7fae5ed68317cb7f255fcb9935284e75b8e (patch) | |
tree | 0614571a5fecfd91927a9198aa0b62728cb14219 | |
parent | ed5b1bb6739b0457a2cbc4296c5247c013dade4e (diff) | |
download | personal-web-aadee7fae5ed68317cb7f255fcb9935284e75b8e.tar.gz personal-web-aadee7fae5ed68317cb7f255fcb9935284e75b8e.zip |
Changes to the 3D Printing.
Mainly some math left out and formatting for functions names.
Diffstat (limited to '')
-rw-r--r-- | _posts/2023-04-18-3d-printing-team.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/_posts/2023-04-18-3d-printing-team.md b/_posts/2023-04-18-3d-printing-team.md index 12e0fde..3ffe023 100644 --- a/_posts/2023-04-18-3d-printing-team.md +++ b/_posts/2023-04-18-3d-printing-team.md @@ -100,25 +100,25 @@ Even if the algorithm implemented for all languages is basically the same, every 1. Initialize a variable for the test case counter. - Dart, Kotlin, Python 1, and Python 2 initialize the counter implicitly by using a loop with a range. TypeScript explicitly initializes a count variable. + Dart, Kotlin, Python 1, and Python 2 initialize the counter implicitly by using a loop with a range. TypeScript explicitly initializes a `count` variable. 1. Read the ink levels for each of the three printers. - Dart, Kotlin, and Python 1 handle reading input in the main loop, whereas Python 2 and TypeScript use separate input handling. Python 2 uses a function (find_color) that takes the number of test cases and printer data as arguments, while TypeScript reads printer data as strings and then converts them into arrays of numbers. + Dart, Kotlin, and Python 1 handle reading input in the main loop, whereas Python 2 and TypeScript use separate input handling. Python 2 uses a function (`find_color`) that takes the number of test cases and printer data as arguments, while TypeScript reads printer data as strings and then converts them into arrays of numbers. 1. Find the minimum ink level for each color (CMYK) across the three printers. - Dart, Kotlin, and TypeScript use a similar approach, calculating minimum ink levels for each color directly using a conditional or Math.min() function. + Dart, Kotlin, and TypeScript use a similar approach, calculating minimum ink levels for each color directly using a conditional or `Math.min()` function. - Python 1 uses NumPy's amin() function to find the minimum ink level for each color, while Python 2 uses nested loops in the find_color() function to find the minimum ink levels. + Python 1 uses NumPy's `amin()` function to find the minimum ink level for each color, while Python 2 uses nested loops in the `find_color()` function to find the minimum ink levels. 1. Calculate the total ink level by summing the minimum ink levels for each color. - Dart, Kotlin, and Python 2 sum the ink levels directly within the main loop, while Python 1 uses NumPy's sum() function. TypeScript uses the reduce() function to calculate the total ink level. + Dart, Kotlin, and Python 2 sum the ink levels directly within the main loop, while Python 1 uses NumPy's `sum()` function. TypeScript uses the `reduce()` function to calculate the total ink level. -1. Check if the total ink level is 10^6 and adjust the ink levels as needed. +1. Check if the total ink level is $10^6$ and adjust the ink levels as needed. - All implementations follow a similar approach, using conditional statements to check the total ink level and adjusting ink levels as needed. Python 2, however, separates this logic into the find_color() function. + All implementations follow a similar approach, using conditional statements to check the total ink level and adjusting ink levels as needed. Python 2, however, separates this logic into the `find_color()` function. 1. Print the adjusted ink levels for each color (CMYK). |