resttitan.blogg.se

Ascii art box
Ascii art box









ascii art box

Frankly the red vbCritical just doesn't go far enough to alarm users when they've really done something horrible. Like most of you, I have always felt Excel lacked a Skull and Bones graphical image as part of the vba MsgBox routine. No doubt some scary person can turn this into a much shorter sed script.A belated happy April 1st friends. In a sense I'm cheating by using $b as a counter in the intermediate loop - I could instead append whitespace in the loop over $a and then use regex replaces for that loop too - but I'm going to allow that slight deviation from a pure-regex solution. # Prepare and print the line containing second horizontal line Y/-/ / # Only relevant first time round the loop S/-x/S|/ # Only relevant first time round the loop S/ /S /g # First time round: left + -> / subsequent times move / left # Read from stdin and set up the initial line # Subroutine to substitute, print, and unsubstitute as described above Because two of the characters used (+ and /) are special characters and turn up a lot in the regexes, it's worthwhile using other characters and substituting them to print. The basic idea is to do everything with regex substitutions. a.outīut other odd sizes are reasonable: $ echo 3 |. Thankfully the spec doesn't say what size one should look like: $ echo 1 |. It could be reduce by using freeform input. Obviously they help but don't add up to enough to kill the wordiess of the language. I tried fortran because of the inline for loops provided by the write statement. And note that markdown doesn't get along well with the indent requirements. No real point in providing a "unobsfucated" version. Since some people asked how long the entries of our contestants were:Īs well as our own solutions (not ranked with the others):

Ascii art box update#

I will update the accepted answer when a shorter one comes along. Trailing whitespace on the lines is ignored.ĮTA: I now accepted the shortest solution. The output is a cube on standard output following above rules. The input, given on standard input, is a single positive, even number n (2 ≤ n ≤ 30) that gives the length of the vertical lines of the cube. Corners are not counted for the length of an edge as detailed above (see examples below as well). A diagonal edge of the cube are drawn with / and consists of n/ 2 characters.A vertical edge of the cube are drawn with | and consists of n characters.

ascii art box

A horizontal edge of the cube are drawn with - and consists of 2 n characters.The receding lines are drawn at half the length as mandated by a cabinet projection.Ĭorners of the cube are represented by +, horizontal lines by -, vertical lines by | and diagonal ones use /.

ascii art box

Since the input is the length of the vertical lines (excluding the corners), horizontal lines are drawn with twice as many characters so that the resulting image is really roughly a cube. Monospaced fonts often have characters that are about twice as high as they are wide. Draw a cube in ASCII art in roughly a cabinet projection.











Ascii art box