Please stop giving hints. However, keep going in your efforts to solve the exact problem. It is a small enough challenge to allow you to discover some of the possibilities in J.
Programming forum Subject: Re: [Jprogramming] table challenge in simple J The grid command works in GTK but this here works similarly in JHS run demo6 in one tab then in the ijx tab do b=: 0 1 2 3 a=: 2 3 5 gdata0 0 1 2 3 4 5 gdata0 =. a +/ b gdata0 2 3 4 5 3 4 5 6 5 6 7 8 refresh the demo6 tab and you get gdata0__+/+/ Change R1, C2 to 56 and tab out of the cell and you have gdata0 2 3 4 5 3 4 56 6 5 6 7 8 The grid above looks different with the sums changed both to the side and below but copy gives the same when trying to copy pasting it gdata0__+/+/ I had to refresh the tab in order to be able to copy paste the changed look of the grid A bit of a surprise actually J and Ajax did their job but the browser did not seem to know about it until after a refresh 2011/11/14 Björn Helgason <[email protected]> > By using grid you get the over and by automatically > > grid a +/ b > > > 2011/11/14 Linda Alvord <[email protected]> > >> In the dictionary in the section on "Verbs and Adverbs" there are two >> definitions designed to produce a table: >> >> >> >> over=:({.;}.)@":@, >> >> by=:' '&;@,.@[,.] >> >> a=: 2 3 5 >> >> b=: 0 1 2 3 >> >> a by b over a +/ b >> >> --T-------┐ >> >> │ │0 1 2 3│ >> >> +-+-------+ >> >> │2│2 3 4 5│ >> >> │3│3 4 5 6│ >> >> │5│5 6 7 8│ >> >> L-+-------- >> >> >> >> Here is the challenge. Use the arguments a and b and define a single >> tacit >> function in "simple J" that does not use @ and provides the same result. >> >> >> >> a table b >> >> --T-------┐ >> │ │0 1 2 3│ >> +-+-------+ >> │2│2 3 4 5│ >> │3│3 4 5 6│ >> │4│4 5 6 7│ >> L-+-------- >> >> >> >> To give a little time for thought, do not post a solution until November >> 18th. I'll post mine then too. >> >> >> >> Linda >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > > > > > -- > Björn Helgason, Verkfræðingur > Fornustekkum II > 781 Hornafirði, > t-póst: [email protected] > gsm: +3546985532 > twitter: @flugfiskur > http://groups.google.com/group/J-Programming > > > Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans > > góður kennari getur stigið á tær án þess að glansinn fari af skónum > /|_ .-----------------------------------. > ,' .\ / | Með léttri lund verður | > ,--' _,' | Dagurinn í dag | > / / | Enn betri en gærdagurinn | > ( -. | `-----------------------------------' > | ) | (\_ _/) > (`-. '--.) (='.'=) ♖♘♗♕♔♙ > `. )----' (")_(") ☃☠ > -- Björn Helgason, Verkfræðingur Fornustekkum II 781 Hornafirði, t-póst: [email protected] gsm: +3546985532 twitter: @flugfiskur http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) ♖♘♗♕♔♙ `. )----' (")_(") ☃☠ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
