[Jprogramming] J TECH Grade 4 Count with Colors Part 3

2015-12-07 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=: 1

Re: [Jprogramming] My first J conjuction

2015-12-07 Thread Linda A Alvord
Yes and Me Too -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Don Kelly Sent: Tuesday, December 8, 2015 12:58 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] My first J conjuction p for Pythago

Re: [Jprogramming] My first J conjuction

2015-12-07 Thread Don Kelly
p for Pythagorus theorem? Don (apologies for the tree format -I tried to get it to look good but blew it.) On 12/6/2015 2:36 AM, Linda A Alvord wrote: Neat! Guess what p stands for? ffp=: 13 : '%:+/*:x,y' 5!:4 <'ffp' ┌─ [: ├─ %: ──┤┌─ [: │├─ / ─── + └──

Re: [Jprogramming] advent 7

2015-12-07 Thread Henry Rich
No, it's an ad-hoc topological sort I wrote for this problem. Input is a list of boxes, each containing a list. Boxes containing 0 or 1 item are 'ripe'; the contents are run together and become the first part of the result. The contents of the ripe boxes are removed from the contents of all the

Re: [Jprogramming] advent 7

2015-12-07 Thread 'Pascal Jasmin' via Programming
Toponm is very impressive. Is there a writeup somewhere on it? - Original Message - From: Henry Rich To: programm...@jsoftware.com Sent: Monday, December 7, 2015 3:18 PM Subject: Re: [Jprogramming] advent 7 Does this solution depend on being able to evaluate the results in lexicogra

Re: [Jprogramming] adventofcode 6

2015-12-07 Thread Joe Bogner
The OCL version of the bytecode interpreter completes instantly and provided the right answer warning: ugly code (no attempt to make nice) https://gist.github.com/joebo/1a9fbb9c2d499209feba On Mon, Dec 7, 2015 at 2:44 PM, Joe Bogner wrote: > Here's my silly version for part 1... We can turn t

Re: [Jprogramming] adventofcode 6

2015-12-07 Thread Jan-Pieter Jacobs
This is my (entirely tacit) solution to problem of day 6. it works by exploiting a pair of nice J features: - ;: for parsing words and it's inverse to piece it together with spaces. - "on","off" and "toggle" defined for changing the lights - "through" for generating lights corresponding to the giv

[Jprogramming] adventofcode 7

2015-12-07 Thread David Lambert
I've taken a straightforward approach using locale name space to track which nouns are known, and to process the instructions for which the names are known, meanwhile gained experience with stack errors and f. , vectors and scalars and {:: . Note 'solve with' LOCALE =: f'instruction.file' a_

Re: [Jprogramming] advent 7

2015-12-07 Thread Henry Rich
Does this solution depend on being able to evaluate the results in lexicographic order of name? The spec doesn't guarantee that. My version: NB. Advent 7 LC =: 'abcdefghijklmnopqrstuvwxyz' '`NOT OR AND LSHIFT RSHIFT' =: (65535&-)`(23 b.)`(17 b.)`(65535 (17 b.) (33 b.)~)`(33 b.~ -) NB. Read i

Re: [Jprogramming] adventofcode 6

2015-12-07 Thread Joe Bogner
Here's my silly version for part 1... We can turn the instructions into bytecodes and run it through the bytecode interpreter I've been playing with: https://gist.github.com/joebo/92738a1c6df841d53b15 I haven't run it through the full 1000x1000 matrix yet. I'm estimating it would take about 3 hou

[Jprogramming] advent 7

2015-12-07 Thread 'Pascal Jasmin' via Programming
Y =: (&{::)(@:]) X =: (&{::)(@:[) excludesolved =: 2 : '(] #~ v) , [ u ] #~ -.@v' c =. (('abcdefghijklmnopqrstuvwxyz' ('z' , leaf ])^:([ e.~ {.every@])"1 0 ])&.;:) each b =. <@( (0 Y ),~ '=:' ,~ }.@(1 Y))@:('-'&cut)"1 a =. > cutLF wd'clippaste' wd 'clipcopy *' , LF joinstring 1 |. ,&>/((2 =

Re: [Jprogramming] essay: toy byte code interpreter

2015-12-07 Thread Alex Shroyer
I also really enjoy this *func* verb. I've never seen a combination of documentation, unit tests, and implementation that was so free of extraneous nonsense. On Sun, Dec 6, 2015 at 1:12 PM, Brian Schott wrote: > Yes, now I see that func is executed when it is read in. For some reason in > this c

Re: [Jprogramming] Very strange......

2015-12-07 Thread 'Jon Hough' via Programming
_base is infinity - infinity*i , apparently. Is that the weird part? On Mon, 12/7/15, Linda A Alvord wrote: Subject: [Jprogramming] Very strange.. To: programm...@jsoftware.com Date: Monday, December 7, 2015, 5:01 PM What is happening here?

[Jprogramming] Very strange......

2015-12-07 Thread Linda A Alvord
What is happening here? base=: 13 :'(3#y)#:i.y^3' [A=:_+/"1 base 2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f=: 13 :'_+/"1 y' f base 2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 5!:4 <'f' -- _ │ -- / --- + --+- " -+- 1 L- ]