ASCII Art is a graphic design technique that uses 93 of the 128 printable ACSII characters to create images.
9
votes
2answers
88 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
631 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
53 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 ...
1
vote
1answer
19 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 ...
18
votes
7answers
2k 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
224 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
253 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" ...
1
vote
2answers
108 views
Printing staircase revisited
What can be more elegant ways to solve the given problem.
#
##
###
####
Code:
...
7
votes
1answer
76 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
811 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
2k 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
33 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
119 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 ...
25
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
111 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 ...
1
vote
1answer
81 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:
...
4
votes
1answer
393 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
58 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 ...
3
votes
3answers
141 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
80 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
667 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 ...
3
votes
2answers
52 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 ...
23
votes
0answers
439 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 ...
1
vote
2answers
95 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 ...
6
votes
1answer
68 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
146 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
345 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
70 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
96 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
177 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
89 views
Output Tildes and Pluses
Inspired by this question, I wrote a program in Whitespace to output the following text:
...
10
votes
1answer
69 views
Printing patterns in Haskell
Write a function Int -> Char -> Char -> [String] that will create the appropriate pattern.
For example: ...
21
votes
8answers
2k 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:
...
8
votes
2answers
960 views
Printing an hourglass pattern
In a recent interview I have been asked to write a program to generate the following output:
...
4
votes
1answer
65 views
Infinite patterned ASCII dice
After seeing Pretty print dice faces from multiple rolls of multi-sided dices,
I decided to make an infinite ASCII dice generator.
There was one requirement, it to follow a normal dice face.
And so I ...
6
votes
2answers
314 views
Beginner Python Dungeon Crawler RPG
I made a game in python which plays a bit like old terminal based RPGs, though a lot more basic. I had originally intended to implement a weapons and armour system and thus remnants of this can still ...
4
votes
1answer
124 views
Pretty print dice faces from multiple rolls of multi-sided dices
In this question related to rolling multiple dices, the OP pretty prints for a single case where number of dices is less than or equal to 6. This led to me finding this code golf on "Draw dice result ...
7
votes
2answers
129 views
Sierpinski triangle from Pascal triangle
I tried to draw a Sierpinski triangle by shading the even number entries of the Pascal triangle. Could you please suggest improvements?
...
6
votes
1answer
290 views
Printing a staircase of text
So basically, a user is prompted to input a number of stairs and a staircase when a guy on it is generated. I know this is sloppy and my variable names are rough, I'm actively working to change them ...
12
votes
1answer
398 views
Printing large numbers, or not large but LARGE
I just started learning Java about a month ago. I'm wondering, what would an experienced developer do differently in the code below? As I learn to code, what direction should I be pushing myself?
I ...
7
votes
3answers
363 views
Shrinking and expanding square
I'm a computer science student who's just starting out with algorithms and their implementation. I wrote this code for a dynamically morphing square. I was wondering if I could get a review on it. I ...
3
votes
1answer
150 views
Printing a Φ pattern using * characters
So I am a newbie obviously, This was part of a small assignment I had to do for Uni, and it works alright. It just reads a number from the console and then outputs the Greek letter Φ (sort of). Sure ...
9
votes
5answers
854 views
ASCII generator
Today I stumbled upon CodinGame, a site with programming challenges. I'll describe one of them.
ASCII art allows you to represent forms by using characters. To be precise, in our case, these forms ...
5
votes
2answers
875 views
Printing out a diamond with a user-inputted size
I made a program that prints out a diamond with n lines. n is equal to whatever the user inputted. I know I overuse the ternary ...
5
votes
1answer
205 views
Using changeable column formatting to display table
When answering python tuition calculator v2, I got a little carried away, and started building a print_table() function which I don't like the resulting code for, ...
10
votes
4answers
456 views
ASCII art generator in C
I have written an ASCII art generator library. I was practicing data abstraction and code abstraction and I wanted to know if there is something that can be improved.
File tree:
...
5
votes
2answers
63 views
Printing octo-thorpes
Given a number, for example, \$6\$, this Python function should print hashes in the following format:
#
##
###
####
#####
######
This is the ...
3
votes
1answer
174 views
Printing an arrow of asterisks in Haskell
This code will print an arrow of asterisks, like:
*
**
***
****
***
**
*
...
6
votes
2answers
230 views
2D array to draw a letter 'F'
This is my code to print letter 'F' with nested loop 2d array. Are there changes that could be made in it to make it look better or more efficient?
...
2
votes
2answers
129 views
Print the length of words as a vertical histogram
I thought I'd give it a shot. What I came up with is from a culmination of my last two submissions, incorporating most of the feedback from this community, including better naming of variables, ...