A mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.
9
votes
3answers
467 views
Console Blackjack game
What do you think the weak points are and how can I improve? I thought I could really use a Hand class in the dealHand method.
...
2
votes
1answer
32 views
A module to display, update and save a dictionary as .csv v2.0
I'd like feedback on my revised code after my previous question.
The goal is to create a module which can display, update, save dictionaries as .csv files. I'll use this in another program to update ...
4
votes
3answers
227 views
Simple “arrow-throwing” console game
I'm trying to make a simple console application game. The code is a bit messy and I hope anyone can point out anything wrong.
...
3
votes
3answers
153 views
A program to display, update and save a dictionary as .csv
I'm now looking for feedback on v2.0 of this program instead.
I'd like some feedback about my code. What bad habits do I have? What advice could help me write more Pythonic?
I'm trying to write a ...
6
votes
5answers
621 views
Petals Around the Rose
I have been working on a program that walks you through "Petals Around the Rose". I would like anyone to review it and point out any bad coding practices, as well as efficiency problems.
...
4
votes
2answers
145 views
Python Hangman Console
I'm quite new to Python and have been experimenting. So far I have made a simple hangman type game which creates a random word and the user than guesses it. I'd like to know if I've committed any bad ...
14
votes
8answers
1k views
Console application for providing detailed error messages
I'm writing a console application where I need to provide detailed error messages in case anything goes wrong. As a result of this, I find myself splitting up my code into many pieces and making sure ...
11
votes
3answers
600 views
Finding largest prime factor from inputted number
This is my first C# console application. This program asks for an input of a number, and finds the highest prime factor of that number. Please review my code.
Have I used things right?
Is my code ...
4
votes
1answer
80 views
5
votes
2answers
175 views
Text-based adventure game with combat and game-reset functionality
Please suggest improvements/refactoring to this game to make it more idiomatic Python.
...
6
votes
3answers
101 views
Returning the lowest and highest number based on input
This simple console program prompts the users for a number and returns the lowest and highest numbers from their inputs. It is difficult to add more user inputs, though. How can I make this easier to ...
6
votes
1answer
118 views
Simple chat console app
I wanted to practice using sockets and multithreading. This is simple code where I start a Server and connect to it via Client ...
10
votes
3answers
122 views
Saving player name throughout script-launches
I would like to use this in a program to save users' names even after they relaunch the script. I was just wondering if there were some ways I could clean up this code.
Note: this currently was made ...
4
votes
1answer
72 views
Permutations program in Python
This code asks for letters and a number of letters per word and generates all possible permutations. Then compares those permutations with an English dictionary and creates a list with all the words ...
3
votes
2answers
60 views
Java Cross with characters
I managed to make a perfectly even cross with for loops.
I'm trying to make this cross easier to code. I have to keep it with ...
7
votes
4answers
613 views
Simple C++ calculator which follows BOMDAS rules
This was my first attempt at making a C++ calculator. The user basically inputs an expression (I'll use \$1+1*(9*(11-1))\$ as an example) and the program searches for and creates a vector for ...
10
votes
2answers
186 views
Hangman game with hard-coded word or phrase
I feel that this implementation can still be simplified. I've tried to keep variable scopes low and have used as much of the standard library as I could.
It currently works with a hard-coded word or ...
3
votes
0answers
67 views
Building a console application using a DI service container
I am working on a project that will allow developers to create a console application using a dependency injection service container. Both the console and container are Symfony components with some ...
13
votes
10answers
2k views
Text-based adventure game with too many conditional statements
For a school project, I am creating a text-based adventure game in C++. I have shown my code to my teacher and he is stating my code is not entirely logical in sequence and that I should make my ...
4
votes
3answers
161 views
Changing the foreground and background colors of substrings based on ANSI escape codes
I am checking for particular keywords in a string, and then changing the foreground and background colors of substrings based on the keywords. Following is the snippet for checking the background ...
4
votes
1answer
65 views
Shortcut script for elusive grep command
This is an example of my filesystem:
/code/
internal/
dev/
main/
public/
dev/
main/
release/
tools/
/code/internal/dev/, /code/public/dev/ and /code/tools/ contain subdirectories for ...
8
votes
1answer
181 views
Bash script to clone all public repos or gists for a specified user, optionally to a directory of choice
I wrote this script as a way to backup and/or download quickly a set of repos or gists from a user. I don't have any major concerns but I'm a noob at bash scripting, and I've been scouring the ...
10
votes
1answer
220 views
Markup calculator application using MVC
I want to make sure that the code is correct in terms of its design, code correctness, best practices & Junit testing.
The complete description is given below:
Functioning of the app quickly ...
6
votes
4answers
482 views
Sum of subset of 5 numbers equals 0
I have a task to print all zero subsets of 5 numbers, input from the console.
I have succeeded in implementing a working code, but it seems it is quite complex (it is like inception) and if the count ...
3
votes
1answer
152 views
Falling Rocks Game
I have implemented the Falling rocks game in C#. The instructions are simple: Don't get hit by rocks. The game is running quite well, however there are some bugs that occur and furthermore, I would ...
4
votes
1answer
64 views
“Agenda” test application for Enum
I'm still new in Java so I always try to find new ways and improve my skills.
I found enum in Java to be very powerful (maybe excessively?) and while I was reading ...
6
votes
2answers
157 views
10
votes
5answers
897 views
Vertically placing the words in a string
Please let me know a better approach to solve below problem:
Problem: Vertically arrange the words in a string and print on console.
Sample Input:
Hello Jack
...
4
votes
1answer
102 views
My HangMan Game
I have been trying to learn C by making a Hangman game. It's not perfect, but with C, I worry that my coding practices will not be very good. I'm also new to allocating memory myself, so I feel I ...
4
votes
2answers
111 views
Different factorial algorithm implementations and measuring their execution time
I'm new to C, and as an exercise I'm building 4 different factorial algorithm implementations and measuring their running time. I'm looking for this feedback, especially:
The implementation of the ...
9
votes
1answer
146 views
Console command tool
I have created a little console tool that simply does commands that you enter.
The commands are stored in a txt file. Right now I only got 2 commands: getTime and ...
12
votes
2answers
201 views
Drink order program
I'm looking to improve my code to make it more efficient, such as shortening it but continuing to gain the same output, or to add some more complex functions into the code.
...
4
votes
1answer
232 views
Calculator for more than two numbers
I am having this problem with my code. I have variables firstnumber and secondnumber, as well as ...
5
votes
1answer
101 views
Console monster battle game
This code currently works, but I'm new to Objective-C from a Python/PHP background. How can I improve it/make it more Objective-Cesque?
Header File/Interface
...
5
votes
2answers
2k views
6
votes
3answers
1k views
Random number guessing game
I'm working on a random number guessing game. I'm done with the code and it's working, but there is a part that I want to make better. I declared an instance of a ...
7
votes
1answer
298 views
Command line reverse polish calculator
Write the program expr, which evaluates a reverse Polish expression from the command line, where each operator or operand is a separate argument.
For ...
2
votes
1answer
194 views
User-defined color implementation in windows console
I have implemented an user defined colors enumerator, and if is possible I appreciate if I will get a code review.
I want to know if my implementation is correctly or must improve it.
If there exist a ...
7
votes
1answer
143 views
Bash script - automate an upload image + description process on a server
I was tasked at work to improve a system where through a web interface a client, which eventually became us, uploads a bunch of images with descriptions (latter coming from csv files), the images are ...
6
votes
1answer
223 views
Simple console roguelike game
I have written this small game for the "learn python the hard way" book. I ask for some opinions about it and how to improve it.
I know about pygame and others game engines but all the game runs in ...
4
votes
0answers
99 views
Reading Intervals from command line
I want to parse a command line using boost.program_options. Most of my command line arguments will be intervals, which I could implement as something like ...
6
votes
2answers
831 views
Console-based menu system
Recently I started learning programming and I created this program. I've added something to it with every new lesson.
How is my code-writing? Do I make mistakes I shouldn't make?
The program itself
...
10
votes
5answers
3k views
Printing star greater symbol in Java
I need to print this in Java. I have written code for this, but I feel that my code is too big.
*
**
***
****
***
**
*
My Code:
...
1
vote
1answer
412 views
Dynamic user-created menus with sub-menus in a command line script
Questions:
How could this code be written better?
Could this be written in less lines of code if constructed using classes?
Also, If the user-created menu items were to be saved to a file for later ...
3
votes
1answer
67 views
cleaner python — refactoring to reduce noise? (twirling cursor)
Questions:
(1) Is the cost of calling subroutines in Python cheap enough to support refactoring, i.e. pulling out flash() as its own subroutine, ...
22
votes
5answers
2k views
Print an ASCII diamond
This takes a width specified by user and prints a diamond of that width. It uses only three for loops, but could I reduce that further? Is there a more elegant ...
4
votes
2answers
117 views
1
vote
0answers
63 views
How does this specific quicksort work? [closed]
I am in school and we are learning sorting algorithms. After quite some struggle, I've managed to create this with the modest help of some googling skills. It has been quite some time and I now no ...
5
votes
3answers
648 views
Battle system in C++
I am not really having any problems with this. I'm just wondering if anybody has any ideas for a path for me to look down for bettering this little FF turn-based style of game in my free time.
I ...
4
votes
1answer
226 views
Turning a Java console app into a server
I'm not familiar with Java at all, so I'd like to get some feedback on this piece of code.
I made it by looking at a few Hello World-esque Java server examples, so it may have drawbacks I'm not ...