answer questions

This lab is very interesting. It's hard at first as you have to understand each command's meaning,
but it gets fun when you get to know the basic logic behind it.
I enjoyed the process of solving problems using the combination of different commands.

This lab is different than lab 1 as it was directly coded in terminal and you could see the direct result after each code
It's kind of logical thinking or math thinking, you need to figure out a way to break down one big problem into small pieces and achive one by one.

I feel that the individual commands looks simple, but the combination of them can achieve many functions.

I was stuck on 5, 7, 10. I use AI to help me figure out 5 but I'm still not sure if there's any other way that could achieve the function, will check with my group.
for 7, I don't know why all the frequencies are the same... for 10, I cannot understand the literal meaning of that question.
I also met some challenges on 8 or 9 (cannot remember), but I tried many times using pluck, then figured it out ; )

I might disucss with my group about these next week as this week we didn't finish this lab before the meeting. And I'm still working on my drawing project.
This commit is contained in:
grace-xing6 2024-09-25 23:20:50 -04:00
parent a931726e4a
commit c05ded45b9
4 changed files with 111023 additions and 10 deletions

View File

@ -10,32 +10,45 @@ 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 | tail
28 antidisestablishmentarianism
## 2. How many words have two u's in a row?
`cat words_100k.txt| match "u.*u.*" | count
2091
## 3. How many words have the word "cat" in them?
`cat words_100k.txt| match "cat" | count
893
## 4. How many words have all five vowels (aeiou)?
`cat words_100k.txt| match "a.*e.*i.*o.*u.*" | count
8
## 5. Which words have two e's in a row, two o's in a row, and two k's in a row? (they don't have to be in that order)
`cat words_100k.txt | grep -E 'ee.*oo.*kk|ee.*kk.*oo|oo.*ee.*kk|oo.*kk.*ee|kk.*ee.*oo|kk.*oo.*ee' | count
3 (this one I counsulted with ChatGPT)
## 6. How many words have sixteen or more letters?
`cat words_100k.txt| length | put 16| lessthan -e | count
696
## 7. What's the most frequent 10-letter word?
`cat words_100k.txt| length | put 10 | equal | frequency | head
I tried this but it seems that the frequency of each words are same: 208000, so I don't know which is the most frequent.
## 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 | tail
13 abcdeilnprtuy 13 unpredictably
13 abceghiloprty 13 copyrightable
13 abceilmnoprtu 13 unproblematic
13 abegiklmnortu 13 troublemaking
13 acegilmnopsty 13 salpingectomy
## 9. What's the longest word which only uses four different letters?
·cat words_100k.txt| length | unique 1 | length |put 4 | equal | pluck 4 | length | order | tail
13 senselessness
## 10. If you rearrange the letters in "sidebar," what other words can you create?
I'm not quite sure what this question mean, I will check with my group.

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