
a rowType identifies either "+-" or "| " and a rowCharacterType identifies one of those two characters.To see the default boxes design, simply provide some input text to it as shown. The boxes are then constructed by making the rows from the characters identified by the rowType and rowCharacterType combinations - i.e. so example 3 takes, ]Įach of these is then converted to a boolean array indicating the rowType or rowCharacterType respectively, e.g. The input taken is a list of the two lists,, and uses the incremented option Jelly, 30 26 bytes Ḣị“+-“| it at TryItOnline \make-some-ascii-boxes.ps1 C:\Tools\Scripts\golfing>. Those strings are all gathered from the pipeline with an implicit Write-Output at program completion, with default newline between them. Then, we loop through $b, each iteration putting two strings on the pipeline - the same style string but with spaces and | instead of hyphens and +, and $x. That's encapsulated in parens so it's placed on the pipeline. Sets variable $x to be the top row of the boxes based on looping through $a and some string concatenation. Takes input $a and $b as explicit arrays. PowerShell v2+, 89 bytes param($a,$b)($x="+$(($a|%ĭang, don't think I can quite catch JavaScript.

) % Index (modular, 1-based) into the string ( % Fill 1 into those entries of the array T % Push another 1 (contents to be filled in) Since indexing is modular and 1-based, index 0 corresponds to the last element (space). Indexing into the string '|-+ ' gives the final result as a 2D char array. This gives the 2D array 3 2 3 3 2 2 2 3 3 2 2 3 3 Now the second array is multiplied by 2, transposed and added with broadcast to the first. Intermediate entries are automatically set to 0.Ī similar array is built for the rows. Extend the array from step 1 by assigning 1 to the entries with (1-based) indices given by step 2.Compute the cumulative sum of the input and add 1.Specifically, this array is built as follows: Note how the length of runs of zeros is related to the input. So if the first input is (would be in the 0-based format) this array will be 1 0 1 1 0 0 0 1 1 0 0 1 1
ASCII ART BOX CODE
The code initially builds an array containing 1 for the column indices of non-space characters in the final result, and 0 otherwise. Uses inputs with 1 added (allowed by the challenge). This is code golf, so the shortest code in bytes win. The second example would then be: 2 3 2 3.


Only the boxes should be printed/displayed, but a trailing space or newlines are accepted.It's easier to explain with a few examples: 0 // No minuses between each + signġ 2 // First a single minus, then two minuses
ASCII ART BOX PLUS
The second input list specifies the number of bars between each plus sign, in the vertical direction. The first input list specifies the number of minuses between each plus sign, in the horizontal direction.
