Questions tagged [ascii-art]

ASCII Art is a graphic design technique that uses the 93 printable/space characters of the 128-character ASCII set to create images.

Filter by
Sorted by
Tagged with
6
votes
3answers
822 views

Pretty-printed tables in Haskell

Purpose A clean, reusable module to generate pretty tables (much like those in SQL-clients), like so: ...
1
vote
1answer
63 views

ASCII triangle in J

I've been doing code golf puzzles to improve my J. I'd appreciate any feedback on my solution to this problem. The task is to take an integer and produce an ascii triangle as follows: ...
8
votes
1answer
832 views

A small Java library for neat printing of binary trees to text console

Given a binary tree (not necessarily a binary search tree), this small Java library implements an algorithm that can neatly print binary trees to text console. Code BinaryTreeNode.java ...
2
votes
3answers
2k views

Print inverse right triangle using recursion

I wrote a program to print the following pattern using recursion to hands on recursion and my output is perfect but I want to know another and the most optimized approach for this. This is the sample ...
4
votes
1answer
334 views

Making a staircase using HTML and CSS

Here is my answer to the question, which I think is quite inefficient considering its length: ...
7
votes
3answers
2k views

Print a chessboard

I'm working through Eloquent Javascript and just did the examples in chapter 2. One is to create a chess board grid of arbitrary size. My code works, but the if/else if statements I used feel clunky. ...
1
vote
2answers
61 views

Printing a pattern through the use of a dictionary

We had to port a c program to python. The code works but uses a dictionary to solve the problem. This doesn't feel like the right use of a dictionary. Is there a better way? ...
4
votes
1answer
238 views

Christmas Tree in Kotlin

Please review my code for printing a Christmas Tree. The idea was to merge some functional programming ideas (immutability, streams) and OOP (every thing is a small object). I'm looking for a review ...
4
votes
2answers
518 views

Creating a border using ncurses

The biggest question is if it's worth it to use a useless if statement to make the x and y ...
6
votes
5answers
991 views

Show a diamond shape with numbers

After seeing this post on StackOverflow, I thought I'd try it out. What I have now is a diamond shape with numbers like this: ...
8
votes
2answers
219 views

Graphical editor programming challenge

I have posted here my working and accepted solution to the graphical editor programming challenge (detailed here) for your review. The program recognizes the following image editing commands: ...
5
votes
2answers
545 views

Simple ASCII art in Rust

I stumbled my way through some Rust yesterday and today to make a simple ASCII art API. It can draw lines, circles, and a canvas. ...
4
votes
1answer
143 views

Print diamond of any size

I'm trying to print a diamond of asterisks of an arbitrary size. I'm new to F#, so I'm interested in virtually any feedback, but especially adherence to idioms, convention, and functional orientation. ...
6
votes
2answers
940 views

Triangle Tessellation Project

I have this Python project to draw tessellated triangles on the screen. It takes the height to form the size of the triangle, cols to specify how many triangles on a line, and rows which is how many ...
13
votes
2answers
6k views

Python ASCII-Art Text Generator

...
14
votes
2answers
936 views

Python ASCII-Art Table

As a part of a console utilities module, I created a function that takes a table in the form of an array of arrays, and generates an ASCII table with the given contents. I've also added the options ...
3
votes
2answers
663 views

Building Better Boxes

I'm working with parameters right now in Java, and my colleague told me that this code of mine is redundant, and I see his point. The for loops do look redundant, but I have no idea how to go about ...
3
votes
1answer
1k views

Creating a triangle

I have two implementation which I modified according to my need to create a triangle or a pyramid like this: * *** ***** ******* ********* First ...
2
votes
1answer
94 views

Pyramid array builder

I'm developing, just for fun and learning, a TypeScript Class that creates an Array<Array<string>> that represents a pyramid. So, for ...
20
votes
7answers
3k views

Print 10 × 10 square of X and O characters, split diagonally

I'm going through a beginners exercise for writing a small program in Java. My task is to print out (i.e. find an algorithm) the following output: ...
6
votes
2answers
489 views

ASCII Paint Bucket

In MS Paint, if we choose paint bucket and fill click on a certain spot, it gets filled with a new chosen color along with its neighboring pixels that are the same color until it reaches certain ...
2
votes
2answers
4k views

Print numbers in a concentric square pattern

I am trying to solve a programming problem on a coding platform. When I execute it on my PC, it works perfectly, but when I submit the code on the coding platform, it throws a "Time Limit Exceeded" ...
3
votes
5answers
7k views

Printing staircase revisited

What can be more elegant ways to solve the given problem. # ## ### #### Code: ...
7
votes
1answer
188 views

A Rusty implementation of CowSay

I'm making my first foray into Rust. I wanted to copy a fun and non utilitarian tool so I chose CowSay. It's not feature complete (CowSay has a lot of options) but it's a start. My primary reasons ...
7
votes
2answers
1k views

Homework to display a square and calculate tips

Here's a simple school assignment I did: Problem 1: Write a program that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using ...
11
votes
7answers
3k views

Java diamond with numbers

I have an assignment to code a method that will print values in a diamond pattern. For example, if the method is called like printNumberDiamond(2), then the results ...
2
votes
2answers
276 views

__str__ method for a tic-tac-toe board

I am making my first object-oriented program in python and I am having trouble with the __str__ part of Board() class. I want it ...
5
votes
2answers
183 views

The right way to hang a man: final part

The problem: Making a simple hangman game. This is a continuation of the following question: The right way to hang a man. There I just tried to make the ascii-gallow. Now I have tried to write the ...
40
votes
1answer
3k views

The right way to hang a man

Problem: I have seen a few questions around hangman. Usually this is done in a very hackish way, which usually can not be generalized any further. My thought or question is about the creation of the ...
6
votes
2answers
558 views

Find number of plus in a 2d array

Problem CharGrid The CharGrid class encapsulates a 2-d char array with a couple operations. int countPlus() Look for a '+' pattern in the grid ...
5
votes
2answers
2k views

Print list items in a rectangular frame

The aim is to have that: list ["Hello", "World", "in", "a", "frame"] And make it printed like this: ...
1
vote
1answer
2k views

Printing chessboard with *(asterisk) and .(dot)

I have written a program in which user enters total number of conditions (cases) and then that many number of inputs to print chessboard. For example: ...
5
votes
2answers
3k views

Beginning of simple rogue-like RPG (in console) in C++

I've started to learn programming recently and it's my first more or less "big" project. But coding this project for me is quite hard. I spent a lot of time to understand what I've done and my coding ...
4
votes
2answers
93 views

Alphabetic Pattern Pyramid

I want to know if I can improve this program. Its goal is to print a pattern in a pyramid form, by first receiving a letter. The first row is always 'A', only. Then 'ABA', then 'ABCBA'. Increasing ...
4
votes
3answers
3k views

Chess board in JS

I've completed the small challenge in the eloquent JS book to create a chess board pattern: Write a program that creates a string that represents an 8×8 grid, using newline characters to separate ...
7
votes
1answer
108 views

CS50 pset-1 itsa Mario - make a half-pyramid using parameters from user input

I'm taking Harvard's introduction to computer science (CS50) course online, and I've written a program that satisfies a coding challenge but I don't understand what I did or how I can improve it. I'm ...
2
votes
7answers
2k views

Producing triangles of asterisks based on height

I have created a simple terminal program: it allows the user to enter a height and it will produce triangles of asterisks (*'s) based on the height. I have just started learning C# as practice for my ...
4
votes
2answers
198 views

K&R C Exercise 1-14: Histogram of the frequency of types of characters

This is for K&R C Exercise 1-14: basically asking to create a program that prints a histogram of the frequency of types of characters. This is done with very basic C functions/knowledge as covered ...
61
votes
1answer
2k views

Printing binary trees

After writing this answer, I was inspired to try to design a more elegant solution to the problem of printing binary trees. And what better tool with which to seek elegance than Clojure? Overall ...
8
votes
2answers
2k views

Printing letters in order like a pyramid

There is this hackerrank question, where we need a rhombus of letters. As to my opinion it can be viewed as some fractal, or similar logic. Well I solved the question, but I am obviously disappointed ...
1
vote
2answers
580 views

Printing multiple different shapes on the same line

Whilst scanning my C programming textbook, I saw this practice problem from a very early chapter: I got to thinking that the problem probably wants you to draw each shape separately, which would be ...
5
votes
1answer
122 views

Creating and displaying a checkers board

I am learning clojure this week end and just starting to develop a simple checkers engine. I currently coded some basic functions to create the board and display it. I would love to get some feedback !...
11
votes
1answer
479 views

The ugly Christmas tree, Haskell style

Inspired by a few inverse tree ascii art F# questions, I wanted to give it a shot in Haskell. As seen in the linked questions, the resulting program reads an Int ...
5
votes
2answers
1k views

xo squares in ASCII

When I finished this problem, I thought about how I initialized my loop iterator variables i and j. Originally I had ...
7
votes
1answer
112 views

World's worst Christmas tree

Inspired by this question, I decided to grow my own fractal tree. The problem is: given an integer \$n\$, \$0 \leq n \leq 5\$, print the \$n\$th iteration of the fractal tree. The tree is probably ...
5
votes
2answers
161 views

Constructing a simple tree with ASCII in F#

This is just a basic HackerRank challenge I was working on to better understand F#. Its purpose is just to print a tree that has a straight 'trunk' of \$n\$, splits into 2 branches which diverge to \$...
6
votes
2answers
363 views

ASCII art minesweeper clone

I wanted to code a small ASCII art minesweeper clone, to see what it looked like and how much code it needed. The result is not so bad, under 80 new lines of code in total. It looks kinda readable to ...
5
votes
1answer
124 views

Output Tildes and Pluses

Inspired by this question, I wrote a program in Whitespace to output the following text: ...
10
votes
1answer
120 views

Printing patterns in Haskell

Write a function Int -> Char -> Char -> [String] that will create the appropriate pattern. For example: ...
22
votes
8answers
3k views

Writing nested for loops to produce certain output

My task: Write nested for loops to produce the following output with each line 48 characters wide: ...