This is a similar problem I solve with j.
The chess game with greatest rating difference may be most fun to observe.
Goal: find the game number having greatest absolute value of rating
difference.
First column is game number. (noun A)
Second and fourth columns are player ratings.
The alphabetical nouns are in order of the steps.
Some data
A=: 0 :0 NB. some data
21 2668 GMNisipeanu 2643 GMIvanisev [ su120 0] 1:53:32 -1:46:26
(36-36) B: 9
263 2626 GMAlekseev 2691 GMMatlakov [ su120 0] 1:15:36 -1:37:24
(34-34) W: 13
115 3004 COMPAndscac 3123 COMPGull [ su120 0] 1:14:06 - 54:06
(35-32) B: 23
)
NB. B looks much like Linda's data
[B =: ;:;._2 A
+--------+-----------+----+----------+-+-----+-+-+--+---+--+-+---+---+--+--+--+--+--+--+--+--+
|21 2668 |GMNisipeanu|2643|GMIvanisev|[|su120|0|]|1:|53:|32|-|1:
|46:|26|( |36|- |36|) |B:|9 |
+--------+-----------+----+----------+-+-----+-+-+--+---+--+-+---+---+--+--+--+--+--+--+--+--+
|263 2626|GMAlekseev |2691|GMMatlakov|[|su120|0|]|1:|15:|36|-|1:
|37:|24|( |34|- |34|) |W:|13|
+--------+-----------+----+----------+-+-----+-+-+--+---+--+-+---+---+--+--+--+--+--+--+--+--+
|115 3004|COMPAndscac|3123|COMPGull |[|su120|0|]|1:|14:|06|-|54:|06 |(
|35|- |32|) |B:|23| |
+--------+-----------+----+----------+-+-----+-+-+--+---+--+-+---+---+--+--+--+--+--+--+--+--+
NB. C is numeric
[C =: _".&.> 0 2 {"1 B
+--------+----+
|21 2668 |2643|
+--------+----+
|263 2626|2691|
+--------+----+
|115 3004|3123|
+--------+----+
NB. D is easy to work with
[D =: ;"1 C
21 2668 2643
263 2626 2691
115 3004 3123
NB. E are the rating differences,
[E =: ([: | [: -/ }.)"1 D
25 65 119
NB. game numbers ordered by rating differences
D/:E
21 2668 2643
263 2626 2691
115 3004 3123
NB. rows of original data ordered by rating differences
([;._2 A) /: E
21 2668 GMNisipeanu 2643 GMIvanisev [ su120 0] 1:53:32 -1:46:26
(36-36) B: 9
263 2626 GMAlekseev 2691 GMMatlakov [ su120 0] 1:15:36 -1:37:24
(34-34) W: 13
115 3004 COMPAndscac 3123 COMPGull [ su120 0] 1:14:06 - 54:06
(35-32) B: 23
Conclusion: observe game 115, which happens to be a match in the current
Top Chess Engine Championship.
Data from http://www.freechess.org/
TCEC at http://tcec.chessdom.com/live.php
On Wed, Jun 29, 2016 at 12:45 PM, Linda A Alvord<[email protected]>
wrote:
>Nowdefine a verb to add a 4th column of the life span of each person.
>
>
>
>A=:'1809';'Philip St. George Cooke';'1895'
>
> B=:'1836';'Flora Cooke Stuart';'1923'
>
> C=:'1833';'Jeb Stuart';'1864'
>
> D=:'1834';'Jacob Sharpe';'189'
>
> [E=:A,B,C,:D
>
>-----T-----------------------T----┐
>│1809│Philip St. George Cooke│1895│
>+----+-----------------------+----+
>│1836│Flora Cooke Stuart │1923│
>+----+-----------------------+----+
>│1833│Jeb Stuart │1864│
>+----+-----------------------+----+
>│1834│Jacob Sharpe │189 │
>L----+-----------------------+-----
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm