HSL ~2022.2 %hw4
Homework #4 for Hoon School Live.

Urbit has several ways to represent and work with text values. The list is broader than just a text representation format, however, and affords the most common way to work with data in Hoon.
adambrettmalin@gmail.com Switch account
Email *
Q0. What is your planet or comet? (Type "our" in the Dojo of your ship to identify if you're not sure—your ship, not your fakeship.) *
Text in Hoon
There are four basic representations of text in Urbit: cords, knots, terms, and tapes.
Q1. Which text representation do each of the following values fall into? *
`@t` cord
`@ta` knot
`@tas` term
`(list @t)` tape
%oddment
~.blubber
'nitwit'
"tweek"
Q2. How would you convert the list `~[114 97 105 110 98 111 119 32 115 104 101 114 98 101 116]` to a `tape`? (You should actually try this in Dojo to make sure your proposal works; it's similar to clearing a type by passing through the empty aura.) *
Q3. The lab needs to know the total quantity of reagent (in grams) you've been able to produce in the past week. You have the totals for every day. Write a gate in an arm `++weekly-reagent` which uses a trap to add up the seven values it receives in a 7-element list. E.g., `~[134 287 12 0 127 194 0]` should sum to 754. (Just answer with the arm; don't worry about the core for this question.) *
Q4. Write a gate in an arm `++fizzbuzz` which accepts a count and counts upward, appending the value OR the appropriate message to a list, which is returned at the end. Include the number unless one of the following conditions holds: `"fizz"` should replace every third number, and `"buzz"` every fifth number until the count is reached. (I.e., given 15, it should count from 1 to 15 with the return list: `~[1 2 "fizz" 4 "buzz" "fizz" 7 8 "fizz" "buzz" 11 "fizz" 13 14 "fizzbuzz"]`.) Make sure that it outputs *both* "fizz" and "buzz" for numbers that are divisible by both three and five. (This hews to canonical FizzBuzz behavior, note the slight difference from %hw3's version.) *
Q5. In the lesson, there was an exercise to produce a library and a generator which counted the number of words in a given tape. The library should consist of a `|%` barcen rune including a `++split-tape` arm and a `++count-elements` arm. Submit the library as your answer here. *
Q6. In the lesson, there was an exercise to produce a library and a generator which counted the number of words in a given tape. The generator should import the library using the `/+` faslus rune and return the number of words in a text sample. Submit the generator as your answer here. *
What are your biggest remaining concerns, points of misunderstanding or fuzzy understanding, or other feedback on Lesson 4?
A copy of your responses will be emailed to the address you provided.
Submit
Clear form
Never submit passwords through Google Forms.
reCAPTCHA
This form was created inside of Tlon Corporation. Report Abuse