Mine still doesn't work, but I added black tabs.  If you cut and paste the
cube together, (black tabs inside) it should show where the colors should
be.

load 'viewmat'
N=:<.63.75*i.5
W=:5 5$100
T=:(4 5$100),5#0
R=:5 5$(4#100),0
L=:|:|.|:R
E=:15$5(#"0)100 0

BLUE=:(2#"1,.(4#0),N),.N,4#255
RED=:2 0 1{"1 BLUE
MAGENTA=:2 0 2{"1 BLUE
GREEN=:0 2 1{"1 BLUE
CYAN=:0 2 2{"1 BLUE
YELLOW=:2 2 0{"1 BLUE
WHITE=:25 3$255
A=:i.5 5
B=:5 5$0
MAGENTA=:(255*~255=MAGENTA)+MAGENTA*254~:MAGENTA
CYAN=:(255*~255=CYAN)+CYAN*254~:CYAN
YELLOW=:(255*~255=YELLOW)+YELLOW*254~:YELLOW
BACK=:25 3$,><"1 (0 1 2 3 4{GREEN)+"1/(0 1 2 3 4){BLUE
TOP=:25 3$,(0 1 2 3 4{RED)+"1/(0 1 2 3 4){BLUE
LEFT=:25 3$,(0 1 2 3 4{GREEN)+"1/(0 1 2 3 4){RED
RIGHT=:25 3$,(8 7 6 5 4{CYAN)+"1/(8 7 6 5 4){MAGENTA
FRONT=:25 3$,(8 7 6 5 4{YELLOW)+"1/(8 7 6 5 4){MAGENTA
BASE=:25 3$,(8 7 6 5 4{CYAN)+"1/(8 7 6 5 4){YELLOW
WOW=:(T,.(|.A),.T),((|:|.25+A),.(50+A),.(|:|.|:|.75+A))
WOW=:(WOW,(R,.(|.|:|.100+A),.L),W,.(125+A),.W),"2,5(#"0) 100 0 100 
(BACK,LEFT,TOP,RIGHT,FRONT,BASE) viewmat WOW

Linda
-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
Sent: Friday, June 26, 2015 10:46 PM
To: Programming forum
Subject: Re: [Jprogramming] Trouble making patter for a color cube

Mike set things up so we can change the colors on the line which invokes
mycube.

I think

30 mycube BLACK,BLUE,CYAN,GREEN,YELLOW,WHITE,MAGENTA,:RED

gets it right. Does that seem right to you?

I've changed the gist to use that line.

Thanks,

--
Raul

On Fri, Jun 26, 2015 at 10:27 PM, Linda Alvord <lindaalv...@verizon.net>
wrote:
> When I looked at it again, there is what I think may be an easily 
> correctable problem.  When you fold up the cube one corner should be 
> the center of a three dimensional graph. Black should extend to blue, 
> red and green from the same corner. Thens the white corner of the cube 
> should be diagonally opposite from the black corner.
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda 
> Alvord
> Sent: Friday, June 26, 2015 10:15 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>
> That's the end of the story folks!  It has been quite a journey.  Now 
> all I have to do is figure out all the options for teaching it to fourth
graders.
> Thank you Bill, Raul, Mike and Brian and everyone who suffered through 
> the many emails.
>
> Linda
>
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul 
> Miller
> Sent: Friday, June 26, 2015 8:31 PM
> To: Programming forum
> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>
> Try https://gist.github.com/rdm/3b11815d4af7392e1f62?
>
> Thanks,
>
> --
> Raul
>
> On Fri, Jun 26, 2015 at 8:21 PM, Linda Alvord 
> <lindaalv...@verizon.net>
> wrote:
>> When I copy and paste your code I get one giant last line  plan=:...
>>
>> Can you show me the line breaks?
>>
>> I get a  two lineerror:
>>
>> |value error: plan
>> |   plan=.BASE(<3 1)}FRONT(<2 1)}(LEFT,TOP,RIGHT)1}BACK(<0 1)}4 
>> |3$BLANK
>> colours=.,/,/>,"_1 each/"1 nsteps mysquarecolours each plan colours
> viewmat
>> i.    ($plan)*nsteps+1
>>
>>
>> Linda
>> -----Original Message-----
>> From: programming-boun...@forums.jsoftware.com
>> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Brian 
>> Schott
>> Sent: Friday, June 26, 2015 4:21 PM
>> To: Programming forum
>> Subject: Re: [Jprogramming] Trouble making patter for a color cube
>>
>> Linda,
>>
>> I am able to make Mike's code work for the following case in jqt and 
>> in
> jhs.
>> Both produce viewmats. Perhaps you could try it because it eliminates 
>> blank lines and includes other side verbs and nouns.
>>
>> NB. Mike Day
>> NB. 6/25/15
>>
>>
>> load'viewmat'
>>
>> 'BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE'=:#:i.8
>>
>> msc=:mysquarecolours =: 3 : 0
>> :
>> nsteps =. x
>> 'A B C D' =. y
>> lamda =. (,:~-.)@:(%~ i.@>:) nsteps
>> AB =. lamda +/@:(*/"1) A,:B NB. mix of colours between corners A & B CD
=.
>> lamda +/@:(*/"1) D,:C NB. mix of colours between corners C & D
>> 1 0 2 |: <.255 * lamda +/@:(*/"1) AB,:CD NB. transpose 'cos I got the 
>> order wrong!
>> )
>> mycube=: 3 : 0
>> :
>> nsteps =. 2 >. <: x
>> 'A B C D H G F E' =. y
>> BLANK =. < BLACK;BLACK;BLACK;BLACK
>> FRONT =. < A;B;C;D
>> BACK =. < H;G;F;E
>> TOP =. < E;F;B;A
>> LEFT =. < H;E;A;D
>> RIGHT =. < F;G;C;B
>> BASE =. < D;C;G;H
>> plan =. BASE(<3 1)}FRONT(<2 1)}(LEFT,TOP,RIGHT)1}BACK(<0 1)}4 3$BLANK 
>> colours =. ,/,/>,"_1 each/"1 nsteps mysquarecolours each plan colours 
>> viewmat i.($plan)*nsteps+1
>> )
>> 30 mycube BLACK,BLUE,WHITE,GREEN,RED,YELLOW,CYAN,:MAGENTA
>>
>>
>>
>>
>>
>>
>> --
>> (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
>
> ----------------------------------------------------------------------
> 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

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

Reply via email to