Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+11 votes
asked in CSC 150 January201920 by (1 point)

2 Answers

+5 votes
 
Best answer

This is the code I used!

let zcor-var -16
let xcor-var 16

repeat 10 [

ask patches [

  if pzcor = zcor-var and pxcor <= xcor-var [ set pcolor red ]
  raytracing:set-reflection .3

]

set zcor-var (zcor-var + 1)

ifelse xcor-var = 16 [set xcor-var (xcor-var - 10)] [set xcor-var (xcor-var - 2)]

So the zcor-var is keeping track of the height that we are filling in, and the xcor-var is keeping track of how long the stair is going to be. We increase the zcor to get a higher level, and decrease the xcor so that the stairs are incremented.

answered by (1 point)
selected by
+1

Is there anyway I could change where the stairs are aligned, I want it on the other side of the cube but when I tried to edit the xcor-var the stairs are either upside down or it fills up the rest of the cube.

+1

This is very creative approach. Thank you Riley

+5 votes

You could single out individual patch by right clicking on them. Or you could set patches to a picture of a really basic version of stairs.

answered by (1 point)
+4

I meant inclined patches in netlogo 3d

+3

I have no clue then.

...