Note the date of the original. This was my simplistic take on the problem.

Linda

-----Original Message-----
From: Linda Alvord [mailto:lindaalv...@verizon.net] 
Sent: Wednesday, November 30, 2011 9:54 PM
To: lindaalv...@verizon.net
Subject: FW: Turkey Roll - Challenge 2 Plain Text Master

Here's my thinking about the Turkey Roll.  I couldn't make the toss as a
noun, but the verb produces different results each time it is executed. I
can imagine that it can be made much better.  I'm always happy when I can
make an idea work at all.
The more fun part is improving the code. Copy and paste into a file in
j701jhs and then run display.

d1=:'    o    '
d2=:'o       o'
d3=:'o   o   o'
d4=:'o o   o o'
d5=:'o o o o o'
d6=:'o oo oo o'
d=:6 9$d1,d2,d3,d4,d5,d6
dice=:(<"2)3 3$"1 d
dice
r=: 13 :'1+?y'
s=: 13 :'c=:r 2 10$y' 
toss=: 13 :'(<"2)3 3$"1(<:s y){d'
toss 6
tt=: 13 :'+/"2 y'
fd=: 13 :'(~.(/:y){y),.+/"1 (~.(/:y){y)=/ y'
toss 6
c
tt c
fd tt c
toss 6
c
tt c 
fd tt c

Linda


-----Original Message-----
From: Linda Alvord [mailto:lindaalv...@verizon.net] 
Sent: Saturday, November 26, 2011 3:29 AM
To: 'Linda Alvord'
Subject: RE: Turkey Roll - Challenge 2 Plain Text Master

Version 2  Plain text.  How can I make the graphic symbols look good?

PLEASE DO NOT REPLY  BEFORE  December I, 2011 at 12:00 am EST !

    The turkey roll challenge, named in honor of the Thanksgiving Day
holiday,  focuses on the verb   roll   or   ?    with one argument.
    
Create two nouns and a verb that will generate the following results.

    dice
----T---T---T---T---T---┐
│ │o │o │o o│o o│o o│
│ o │ │ o │ │ o │o o│
│ │ o│ o│o o│o o│o o│
L---+---+---+---+---+----
    toss
----T-T---T-T---T-T---T-T---T-T---T-T---T-T---T-T---T-T---┐
│o │ │o o│ │o o│ │o o│ │o │ │o o│ │o │ │o o│ │o │ │o o│ │ │ │ │ │ o │ │o o│
│ o │ │ │ │ o │ │ o │ │ o │ │o o│ │ o│ │o o│ │o o│ │o o│ │ o│ │o o│ │ o│ │o
o│ │ o│ │o o│
+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+
│ │ │o o│ │o │ │o o│ │o o│ │o o│ │o o│ │o │ │ │ │o o│ │ o │ │ │ │ │ │o o│ │o
o│ │ │ │o o│ │ │ │ o │ │o o│ │ │ │o o│ │ o│ │o o│ │o o│ │o o│ │o o│ │ o│ │ │
│o o│
L---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+----
    toss
----T-T---T-T---T-T---T-T---T-T---T-T---T-T---T-T---T-T---┐
│o │ │o o│ │o o│ │o o│ │o │ │o o│ │o │ │o o│ │o │ │o o│ │ │ │ │ │ o │ │o o│
│ o │ │ │ │ o │ │ o │ │ o │ │o o│ │ o│ │o o│ │o o│ │o o│ │ o│ │o o│ │ o│ │o
o│ │ o│ │o o│
+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+
│ │ │o o│ │o │ │o o│ │o o│ │o o│ │o o│ │o │ │ │ │o o│ │ o │ │ │ │ │ │o o│ │o
o│ │ │ │o o│ │ │ │ o │ │o o│ │ │ │o o│ │ o│ │o o│ │o o│ │o o│ │o o│ │ o│ │ │
│o o│
L---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+----
    c=:3 8 7 12 9 8 9 7 4 12      NB.  The list  c  is the sums of the
                                  NB.  second toss of ten dice
    fd c
3 1                               NB.  A frequency distribution of the

4 1                               NB.  ten tosses
7 2
8 2
9 2
12 2

    4!:0 'dice';'toss';'c';'fd' 
0 0 0 3                          NB. 0 for nouns, 3 for verbs


Some rules and hints:

     Write all verbs and nouns without  @ .  You can use several nouns and
verbs to make a final noun or verb.  Here are some things about  roll.  

     r=: 13 :'?y'
     r
? 
    r 4
3
   r 4
2
   s=: 13 :'r 3 4$y' 
   s
[: r 3 4 $ ]
   s 5
3 3 3 2
3 2 3 4
2 4 0 4
   s 5
1 3 1 0
3 1 4 1
4 2 1 3
    t=: 13 :'(r s y)*3 4$100*i.4' 
    5 t 5
1003 1000.69 1000.5 1001.49
1001 1000.55 1000 1001
1000.89 1001.03 1002 1000
    5 t 5
1001 1002 1000 1001.37
1003 1000.04 1000.23 1002
1000.01 1001 1000.3 1001.16

Be sure to get unique results as you go.  Notice how to build a complex
result with several shorter functions. 

Linda

----------------------------------------------------------------------
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