Linda Alvord wrote:
> 
>  
> 
> It was David Ward Lambert's idea to write a one line expression with the
> fewest tokens.  We worked together and got to 40 tokens.  Any ideas to
> make
> this any better.
> 
>  
> 
>    B=:'a big arrow focused somewhere'
> 
>    NB.  center justify (Hint from DWL  x |."0 1 y)
> 
>    cj=: 13 :'(-<.-:+/"1 '' ''=>;:y)|."0 1>;:y'
> 
>    cj
> 
> ([: - [: <. [: -: [: +/"1 ' ' = [: > ;:) |."0 1 [: > ;:
> 
>    cj B
> 
>     a    
>    big   
>   arrow  
>  focused 
> somewhere
> 
>    NB. quarter turns
> 
>    qtla=: 13 :'y;(|:|.y);(|.|:|.|:y);(|.|:y);y'
> 
>    qtla
> 
> ] ; ([: |: |.) ; ([: |. [: |: [: |. |:) ; ] ;~ [: |. |:
> 
>    qtla cj B
> 
> ----------T-----T---------T-----T---------┐
> │    a    │s    │erehwemos│    e│    a    │
> │   big   │of   │ desucof │   dr│   big   │
> │  arrow  │moa  │  worra  │  wee│  arrow  │
> │ focused │ecrb │   gib   │ gosh│ focused │
> │somewhere│wuria│    a    │airuw│somewhere│
> │         │hsog │         │ brce│         │
> │         │eew  │         │  aom│         │
> │         │rd   │         │   fo│         │
> │         │e    │         │    s│         │
> L---------+-----+---------+-----+----------
> 
>    NB. 5 quarter turns David Ward Lambert
> 
>    qtdwl=: 13 :'<"2 ([:|:|.)^:(<5)y'
> 
>    qtdwl cj B
> 
> ----------T---------T---------T---------T---------┐
> │    a    │s        │erehwemos│    e    │    a    │
> │   big   │of       │ desucof │   dr    │   big   │
> │  arrow  │moa      │  worra  │  wee    │  arrow  │
> │ focused │ecrb     │   gib   │ gosh    │ focused │
> │somewhere│wuria    │    a    │airuw    │somewhere│
> │         │hsog     │         │ brce    │         │
> │         │eew      │         │  aom    │         │
> │         │rd       │         │   fo    │         │
> │         │e        │         │    s    │         │
> L---------+---------+---------+---------+----------
> 
>    qtdwl
> 
> [: <"2 ([: |: |.)^:(<5)
> 
>    
> 
>    wave=: [: <"2 [: ([: |: |.)^:(<5) ([: > ;:)|."0 1~ [: - [: <. [: -: [:
> +/"1 ' ' = [: > ;:
> 
> 
Here is a 39 token version:

   wave1=:[: <"2 [: ([: |: |.)^:(<5) [: (|."0 1~ [: - [: <. [: -: [: +/"1 '
' = ]) [: > ;:

   #;:'[: <"2 [: ([: |: |.)^:(<5) [: (|."0 1~ [: - [: <. [: -: [: +/"1 '' ''
= ]) [: > ;:'
39



> 
>    wave B
> 
> ----------T---------T---------T---------T---------┐
> │    a    │s        │erehwemos│    e    │    a    │
> │   big   │of       │ desucof │   dr    │   big   │
> │  arrow  │moa      │  worra  │  wee    │  arrow  │
> │ focused │ecrb     │   gib   │ gosh    │ focused │
> │somewhere│wuria    │    a    │airuw    │somewhere│
> │         │hsog     │         │ brce    │         │
> │         │eew      │         │  aom    │         │
> │         │rd       │         │   fo    │         │
> │         │e        │         │    s    │         │
> L---------+---------+---------+---------+----------
> 
>    wave
> 
> [: <"2 [: ([: |: |.)^:(<5) ([: > ;:) |."0 1~ [: - [: <. [: -: [: +/"1 ' '
> =
> [: > ;:
> 
>    #;:'[:<"2[:([:|:|.)^:(<5)([:>;:)|."0 1~[:-[:<.[:-:[:+/"1'' ''=[:>;:'
> 
> 40
> 
>  
> 
> Hopefully David will send his version of 39 tokens but not simple J.  Note
> also that you must paste the long line for wave together.
> 
>    
> 
> Linda   
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> From: Linda Alvord [mailto:lindaalv...@verizon.net] 
> Sent: Tuesday, May 01, 2012 3:17 AM
> To: 'Linda Alvord'
> Subject: Challenge 11 Wave the Flag
> 
>  
> 
> Challenge 10 Wave the Flag    PLEASE DO NOT RESPOND UNTIL 5/28/2012  12 am
> EST
> 
>  
> 
> Here's a little preparation for Memorial Day.
> 
>  
> 
>   S=:10 16$(16$' '),176$(16$'*  '),16$' * '
> 
>    T=:10 36$(36$'#'),72$' '
> 
>    U=:9 52$(104$' '),364$(52$'#'),104$' '
> 
>    <' ',"1(((S,"1 ' '),.T),U),"1 ' '
> 
> --------------------------------------------------------┐
> │                  #################################### │
> │ *  *  *  *  *  *                                      │
> │  *  *  *  *  *                                        │
> │ *  *  *  *  *  * #################################### │
> │  *  *  *  *  *                                        │
> │ *  *  *  *  *  *                                      │
> │  *  *  *  *  *   #################################### │
> │ *  *  *  *  *  *                                      │
> │  *  *  *  *  *                                        │
> │ *  *  *  *  *  * #################################### │
> │                                                       │
> │                                                       │
> │ ####################################################  │
> │                                                       │
> │                                                       │
> │ ####################################################  │
> │                                                       │
> │                                                       │
> │ ####################################################  │
> L--------------------------------------------------------
> 
>  
> 
> Part 1:  Use viewmat and create a little flag. Next design a function to
> rotate it clockwise 90 degrees successively until it is in the original
> position.
> 
>  
> 
>    load viewmat 
> 
>    flag=:
> 
> wwwwwwww
> wwwwwwww
> wwwwwwww
> wwwwwwww
> 
> wwwwwwwwwwwwww
> 
> wwwwwwww
> wwwwwwww
> wwwwwwww
> wwwwwwww
> 
> wwwwwwwwwwwwww
> 
> wwwwwwww
> wwwwwwww
> wwwwwwww
> wwwwwwww
> 
> wwwwwwwwwwwwww
> 
> wwwwwwww
> wwwwwwww
> wwwwwwww
> wwwwwwww
> 
> wwwwwwwwwwwwww
> 
> wwwwwwww
> wwwwwwww
> wwwwwwww
> wwwwwwww
> 
>    
> 
> Part 2:   
> 
>  
> 
>    A=:'we celebrate Memorial Day on May the twenty eighth'
> 
>    wave=:
> 
> ------------T-----------T-----------T-----------T-----------┐
> │----------┐│----------┐│----------┐│----------┐│----------┐│
> ││   we    │││      Mc │││  hthgie │││ e       │││   we    ││
> ││celebrate│││et    ee │││  ytnewt │││ tl      │││celebrate││
> ││Memorial │││iw    ml │││   eht   │││ aa    yh│││Memorial ││
> ││   Day   │││getMoDoew│││   yaM   │││ riy yett│││   Day   ││
> ││   on    │││hnhanarbe│││    no   │││ebranahnh│││   on    ││
> ││   May   │││ttey yir │││   yaD   │││weoDoMteg│││   May   ││
> ││   the   │││hy    aa │││ lairomeM│││ lm    wi│││   the   ││
> ││ twenty  │││      lt │││etarbelec│││ ee    te│││ twenty  ││
> ││ eighth  │││       e │││    ew   │││ cM      │││ eighth  ││
> │L----------│L----------│L----------│L----------│L----------│
> L-----------+-----------+-----------+-----------+------------
> 
>  
> 
> Reshape A into a 9 9 square matrix. Justify all lines in the center. If a
> line has an even number of letters put the extra letter on the left. Now
> design a function to rotate the words in a similar fashion to the flag
> above.  Note the letters in "we" as they move around clockwise. Your
> function should work for any square literal matrix.
> 
>  
> 
> Happy Memorial Day!
> 
>  
> 
> Linda
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 

-- 
View this message in context: 
http://old.nabble.com/Re%3A-Challenge-11-Wave-the-Flag-tp33948875s24193p33948951.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to