Forum Discussion
Patrick2788
Nov 29, 2022Silver Contributor
Formula Challenge: Create a guitar fretboard diagram
This exercise has helped in my ongoing studies of Excel and learning acoustic guitar. The challenge is to produce the standard tuning (E-A-D-G-B-E) diagram: [This diagram lists 'natural' n...
Patrick2788
Dec 02, 2022Silver Contributor
For some more practice with the method Peter has outlined in this discussion, I've attempted to apply this approach to a Rubik's cube exercise I've been playing with every now and then.
The goal is simply to create this array:
My previous solution involved creating the middle 1-4 blocks and then stacking and expanding the rest. Not exactly elegant but it got the job done.
With the new approach, I started with an array constant:
={5,"","",1,2,3,4,"",6,"",""}
Created a 3x3 matrix of blanks
=EXPAND("",3,3,"")
Created the Lambda called 'MStack', intended to be used in REDUCE
=LAMBDA(matrix,v,HSTACK(matrix, EXPAND(v, 3, 3, v)))
Next, comes a named item called 'Matrix'. My intent was to deliver the solution at this step, but it needed 1 more step.
=REDUCE(Blanks,ArrConst,MStack)
A Lambda - 'Rubik'
=LAMBDA(Stack,VSTACK(TAKE(Stack, , 12), TAKE(DROP(Stack, , 12), , 12), TAKE(Stack, , -12)))
Finally, at the sheet level:
=Rubik(Matrix)