User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
journal:spring2020:acliteur:week8 [2020/03/17 12:35]
journal:spring2020:acliteur:week8 [2020/03/17 12:59] (current)
Line 3: Line 3:
 ====MONTH Day, YEAR==== ====MONTH Day, YEAR====
 Project done: upf1, pct9 Project done: upf1, pct9
 +pct9 was the first letter division I had that was in base-8. This meant that there were only 8 letters to solve for, and that the number system goes: 0, 1, 2, 3, 4, 5, 6, 7, 10, 11... The **10** is not **ten** as that would be a decimal. Whenever a letter borrows from another, it can be assumed that it will increase its value by 8, since the value to the left is an order of magnitude greater, or relatively, **8^1**. Not many operations were different because of the puzzle being in base-8.
 +In upf1 an '​if'​ statement creates project directories oly if the user running the script is the owner. I set the script to make files IF **${USER} = '​acliteur'​**. Then I had to install unittools, this time the LATEST file did not have the exact name of the file to download. I downloaded unittools as a whole, catted it, grepped to find the content in LATEST, then cut it down to create the file needed to download. Then fetched said latest file. It looked like: **cat unittools | grep "​${LATEST}"​ | cut -d '"'​ -f4 > LATESTFILE**
 +The task for upf1 was interesting,​ as there were many specific errors I had to overcome, although I did not overcome it in an elegant fashion. The argument '​N'​ makes no space between the value and the unit, and found out this worked for every conversion as long as the -N was in the last argument. The '​d'​ argument set the delimiter, I found that making the delimiter **''​**,​ allows the conversion to flow to the next and look nice. The -p delimiter allows the value of the precision. So I used **-p5** makes the unit be accurate up to 5 decimals.
 +A for loop was made to drive the final output of the task into the standard output. If the TASK is 0 or less than the FINALTASK which is 7, then it will echo the task# and task output for that number, then add 1 to the task, and repeat.
journal/spring2020/acliteur/week8.txt · Last modified: 2020/03/17 12:59 by acliteur