Challenge
Write a function that will draw a pyramid. The function should take one integer parameter that will describe how many lines tall the pyra...
For further actions, you may consider blocking this person and/or reporting abuse
Fun challenge :) I did it in React, so here's the function:
and here's a demo!
Python one-liner yet again :)
Impeccable
I have no Go pun this time. Sorry, I need coffee for that.
pyramid.go
pyramid_test.go
Since this is pretty much the top half of a string diamond I took my answer from that challenge and used just the first half of the code but it isn't working like expected, can someone tell me where I went wrong? 😥
Ruby:
Here it is!
The right padding isn't necessary, but hey why not
My try. I used
padStart
andpadEnd
, and abused default parameters a bit, just for fun.CSS
This is a variation of my solution for challenge #2. Just add the class "triangle" to a block element, and specify the lines in the CSS variable
--stars
:The idea is having an inline SVG background with the asterisks, then clipping the shape of the triangle. Here is a demo on Codepen:
F#:
My solution in js
Javascript, can be run from the command line:
Python
This is really close to challenge #2
Rust:
[gist.github.com/devparkk/9b0e19758...]
Isn't that a triangle?