Everybody likes games, right?
I once entered a golfing competition writing the logic behind mastermind,
and end up with a neat thing of 21 characters:

mm=: =,&(+/)(~:#[)e.&~.~:#]

This takes as left and right arguments the secret and the proposed
solution, respectively, with the left one being the secret, and the right
one the proposed solution. The results are the numbers of white and black
pegs:

    'rgby' mm 'rrmw'
1 0
    1 2 2 3 mm 3 4 2 1
1 2
    'rgba' mm 'rgba'
4 0

See http://codegolf.stackexchange.com/a/12497/665 for the explanation

It uses quite a bit of concepts, but I think it is small enough to explain
in 5 minutes.
It would be even cooler to couple this to a GUI, which seems to be easy to
make, but I have no experience with in J.
Or an AI player...

Thoughts, suggestions and GUI's from the guru's are welcome ;).

Jan-Pieter


2014-02-23 3:42 GMT+01:00 Pascal Jasmin <godspiral2...@yahoo.ca>:

> I think Henry mentioned that the demo should not be about
> teaching/explaining J, but rather doing cool stuff.  In that sense, its ok
> if it looks like line noise to a new user (though it should be absorbable
> if they go back to it after a tutorial), as long as the inputs and outputs
> are explained and impressive.  To me, even if a new language looks like
> line noise, I would be impressed that a whole program fits on one line, and
> small changes to the line produce ever more impressive results.
>
> You can cheat and use the input log instead of typing.
>
> I wouldn't treat 5 minutes as a hard deadline either.  If you want your
> video to be more about teaching J, I'm sure that would also be great, and
> none of us will stop you :)
>
>
> ----- Original Message -----
> From: Brian Schott <schott.br...@gmail.com>
> To: Programming forum <programm...@jsoftware.com>
> Cc:
> Sent: Saturday, February 22, 2014 12:04:03 PM
> Subject: Re: [Jprogramming] J in 5 minutes
>
> Pascal,
>
> I can't remember the sequence of emails, but I do remember asking in a
> relevant thread if anyone had found a way to make a grid into active cells
> accepting excel-like formulae, with the idea that many people would find
> the transition to J easier if that were possible. And if memory serves
> correctly, you may have responded to that idea with the example and code
> about computing loan balances -- whether or not there is any truth to that
> is not very important, perhaps. But anyhow, the lack of a positive response
> to my request for an excel-like grid and your example, revised my thinking
> considerably regarding a j-in-5 video/essay away from an excel-in-J
> demonstration. So, thank you for your multiple contributions to my effort
> for an essay/video; your ideas have been great.
>
> I just think the audience your newest example would appeal to is not one
> that I chose to pursue. My video exceeds 5 minutes already, and I am
> basically explaining only upd/\.p, 10000 . Your expansion to me would
> require a lengthy Lab sort of delivery system, not a 5-minute video, unless
> the audience already understands financial calculations.
>
> Maybe, I am completely wrong. I am thinking about Joe's screencast on
> database retrievals. He can type really fast and can talk easily (which I
> cannot do) and is able to fly through many examples in no time. Maybe I
> should be thinking like that and how impressive a screencast of your
> examples would be. But I cannot do that because my speaking ability is very
> limited and does not permit simultaneously typing, so even such a
> presentation would be impossible for me to develop. Maybe even folks who
> don't understand financial calculations would be impressed with your
> examples to choose J.
>
> Thanks,
>
>
>
>
> On Sat, Feb 22, 2014 at 8:10 AM, Pascal Jasmin <godspiral2...@yahoo.ca
> >wrote:
>
> > I can definitely be wrong about this, but I thought my example was both a
> > simple concept, but still daunting to code.  Its about the beauty/power
> of
> > J for people who already understand daily interest loans, which I admit I
> > may overestimate how widespread that knowledge is, or how a single
> sentence
> > overview of daily interest can suddenly make everyone perfectly aware of
> > the concept.
> >
> > It is still an example that uses only + - * [], ^ inv $ as verbs, which
> > are among the easiest to explain.  Maybe a good intro, would be to show
> how
> > a spreadsheet would solve the problem for 10 periods with all of the
> > columns it would use.  Its easy but tedious to use a spreadsheet to solve
> > the problem (with small number of very regular payments).  By showing the
> > spreadsheet model, then even non programmers, or those not completely
> > familiar with interest calculations, would be able to follow  the J
> > approach that improves upon it.  New lines could even be explained with
> an
> > overview of the changes to the spreadsheet that would need to be made to
> > match the J code.
> >
> >
> > --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to