made 3 new .txt files, answered exercises

This lab forced me to slow down and write out what I actually wanted to do, especially
as I needed to use things like "length" more than once in order to avoid indexing errors.
There were a couple of times that I wanted to use commands that didn't exist (greaterthan)
and because of the limitation, I needed to figure out how to use the commands that I did have
in a different or maybe less (more?) obvious way in order to solve the problem. With the
sixteen or more letters words, just changing the order I was comparing things solved my
problem, which looking back makes complete sense.

A few of us worked on this together on Friday and a few of the exercises we left as "this
needs to percolate a little bit" but coming back to it today (Monday) I was flying. So either
I made some huge mistakes or taking a step back and disengaging for a little bit helped me
come back and focus back in on what I was trying to accomplish. It was really nice, both from
an enjoyment and helpfulness standpoint, to work on the exercises as a group. I'm a firm believer
in most effectively learning something by having to explain it to someone else, so when one of us
got an answer and had to explain to everyone else why it worked, we ended up finding that a few
of the more confident solutions were actually flawed. If I were by myself, I probably would not have
checked my work as diligently.
This commit is contained in:
Pat Wick 2023-07-31 10:26:24 -04:00
parent 7495d3dd79
commit 3a0b5e8881
4 changed files with 111010 additions and 10 deletions

View File

@ -10,32 +10,32 @@ If you want to be really stylish, put your code inside of backticks like this:
`cat words_100k.txt | length | put 10 | equal | count`
## 1. What is the longest word?
`cat words_100k.txt | length | order -r | head -n 1`
## 2. How many words have two u's in a row?
`cat words_100k.txt | match "uu" | count`
## 3. How many words have the word "cat" in them?
`cat words_100k.txt | match "cat" | count`
## 4. How many words have all five vowels (aeiou)?
`cat words_100k.txt | match "a" | match "e" | match "i" | match "o" | match "u" | count`
## 5. Which words have two l's in a row, two m's in a row, and two t's in a row? (they don't have to be in that order)
`cat words_100k.txt | match "ll" | match "mm" | match "tt"`
## 6. How many words have sixteen or more letters?
`cat words_100k.txt | length | put 16 | lessthan 0 1 -e | count`
## 7. What's the most frequent 10-letter word?
`cat words_100k.txt | length | put 10 | equal 0 1 | frequency 2 | order -r | head -n 1`
## 8. What's the longest word which doesn't have any repeated letters?
`cat words_100k.txt | length | unique 1 | length | equal 0 2 | order 2 -r | head -n 1`
## 9. What's the longest word which only uses four different letters?
`cat words_100k.txt | length | unique 1 | length | put 4 | equal 0 1 | order 3 -r | head -n 1`
## 10. If you rearrange the letters in "sidebar," what other words can you create?
`cat words_100k.txt | length | unique 1 | match "abdeirs" | length | equal 0 2 | pluck 3`

100000
words_100k.txt Normal file

File diff suppressed because it is too large Load Diff

10000
words_10k.txt Normal file

File diff suppressed because it is too large Load Diff

1000
words_1k.txt Normal file

File diff suppressed because it is too large Load Diff