Re: [Jprogramming] adventofcode 6

2015-12-08 Thread Brian Schott
Jan-Pieter, Thank you very much for your solution. Puzzling through it really helped me. I think your approach is really clever and your comments were perfect. I had trouble understanding your off, on, an toggle until I realized you were updating the whole array each time, because my (incomplete)

[Jprogramming] Did this message (sent 1:44 am) go to junk mail?

2015-12-08 Thread Linda A Alvord
A big idea in Grade 4 is helping students understand fully how base 10 works. Here is a dialog which might help students to understand number systems in general. So, if you have 64 different colors, how high can you count with unique numbers? Here's the dialog? load 'viewmat' base=: 13 :'(

Re: [Jprogramming] Did this message (sent 1:44 am) go to junk mail?

2015-12-08 Thread Raul Miller
Personally, I usually prefer 1+x instead of >: x, unless the >: serves some relevant purpose (like if I am defining addition in terms of more basic operations, or if I'm using an & and don't want parenthesis or that sort of thing). I'm not sure, though, if that fits your lesson concept? Thanks,

[Jprogramming] adventofcode/day/8

2015-12-08 Thread David Lambert
Part 1, a chance to exercise the FSM. The states here are sufficient for character count. Raul's annotated state table style is worth reiterating, hence this post. Fixed width font aligns the columns. mp=: +/ .* S=: +. ". }. [;._2 noun define bore hex \"xLF 0j6 0j6 0j6 6j0

Re: [Jprogramming] adventofcode/day/8

2015-12-08 Thread 'Pascal Jasmin' via Programming
to use, (0;S;M) ;: wdclippaste '' - Original Message - From: David Lambert To: programming Sent: Tuesday, December 8, 2015 10:23 AM Subject: [Jprogramming] adventofcode/day/8 Part 1, a chance to exercise the FSM. The states here are sufficient for character count. Raul's annotat

Re: [Jprogramming] adventofcode 6

2015-12-08 Thread Jan-Pieter Jacobs
You're welcome! The parsing does only use negative indexing though (mainly to easily get rid of the "turn", as the "toggle" cases don't have an element to get rid of ...) Actually, I had errors in the updating functions too before ... What you see is only the final result :) 2015-12-08 14:38 GMT+

Re: [Jprogramming] Did this message (sent 1:44 am) go to junk mail?

2015-12-08 Thread Linda A Alvord
I like 1+ and should have used it since Grade 1! To understand the lesson you have to look especially at the first two images. With no numbers and two different crayons see how high you can count. Now use 3 different crayons and "write" as namy "numbers" as you can using only your three crayons

Re: [Jprogramming] adventofcode 6

2015-12-08 Thread Brian Schott
Jan-Pieter, I used my "amend" approach with your great parsing and your method was 4 times as fast and 6.3 times as space efficient as mine. FYI, my definitions are as follow. cells =: <@{.+each,@{@(<@:i."0@(>:@-~/))@] toggle =: -.@(cells@[ { ])`(cells@[)`]} on =: 1:`(cells@[)`]} off =: 0:

Re: [Jprogramming] My first J conjuction

2015-12-08 Thread Don Kelly
pyth=: 13 : '| x+j.y' also works but does call on complex numbers-not generally grade 4. pyth [: | [ + [: j. ] 5 pyth 4 6.40312 You must have a great grade 4 class. Don On 12/7/2015 10:35 PM, Linda A Alvord wrote: Yes and Me Too -Original Message- From: programming-boun...

Re: [Jprogramming] My first J conjuction

2015-12-08 Thread Linda A Alvord
Nice. Probably Grade 9 or 10 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don Kelly Sent: Tuesday, December 8, 2015 9:42 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] My first J conj