r/PowerShell • u/mdowst • Sep 18 '19
Parenting Through PowerShell
My 8 year old decided to pretend to be sick so he would get sent home from school the other day. So after we finished all the work the teach gave us, I decided to make him some extra work. Since they are learning double digit addition I wrote a quick script that will generate a page with 25 problems on it. I kept printing him off new sheets until the end of the regular school day.
I thought I'd share it in case anyone else has a 2nd grader who likes to play hooky. https://www.dowst.dev/homework-double-digit-addition-without-carrying/
Does anyone else have any examples of parenting through PowerShell?
229
Upvotes
4
u/ka-splam Sep 18 '19 edited Sep 18 '19
Off topic; I was trying to do this in APL, and I came up with the idea of generating all combinations of two digit number addition into a table, filtering the ones below 100, taking the (x, y) axis indices of those as the available choices of addition problems for the worksheet, then taking nine pairs at random:
e.g. these pairs.
Formatting them was as difficult and frustrating again, but I ended up with a neat grid. Room for the answer, and an underline, left as an exercise for the reader, lol.
TryAPL.org link for
3 3 ⍴ {(⍪' +'),↑⍵}¨ (⊢⌷⍨(⊂9?⍴)) ⍸100>∘.+⍨9+⍳90yes this took ages. yes this generates 8,100 pairs to find 9 random ones just to avoid using a loop around an if/else.