A mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.

learn more… | top users | synonyms (2)

4
votes
2answers
57 views

Java CLI Program Commands

As I was creating a CLI program, I realized having a ton of switch/if-then statements was a messy way to process user input. So, I set up a way to dynamically create commands as I added modules (...
1
vote
2answers
30 views

Calculate fractions of positive, negative and zeros

Find the fractions for, all positive numbers, all negative numbers and zeros in a given set of integer array. I wrote the below program. If you see any improvements required, please feel free to ...
2
votes
1answer
53 views

Console argument parsing and output printing in c#

I have a console application, which uses Ndesk.Options to parse console arguments, request weather data and print them. I am looking primarily for code style suggestions. This is the code, which ...
2
votes
0answers
178 views

Console command parser for my custom Libgdx console (gamedev)

For a game I'm writing using LibGDX framework and Kotlin language, I've decided to make a dev console. This is a WIP line parser. Since there's already a decent amount of code written I've decided to ...
4
votes
1answer
376 views

Display a List<T> in Console

I was searching for a way to display a List<T> with n elements in a user friendly and easy to handle way within the console application. So I wrote this ...
0
votes
1answer
47 views
25
votes
4answers
3k views

Loading… animating dots in C

I've recently wanted to make a "Loading..." display in C where the dots print one at a time in order and then reset: Suprisingly, there isn't much on the internet for doing this well, so I figured ...
10
votes
1answer
105 views

Autocompleting console input

Yesterday I stumbled upon a Stack Overflow question that asked if it was possible to implement Tab-triggered auto-completion in a console application. I thought that was an interesting idea, so I ...
3
votes
3answers
84 views

BMI calculator in Python

This is my first attempt at writing a programme: a BMI calculator written in Python. Please give me feedback on the programme overall, as well as how easy the code is to interpret and adapt. ...
-1
votes
2answers
85 views

Object-oriented console adventure

I have been messing around with practicing some c++ making a little console game, and I would like to receive some advice and tips on how to improve my code. Some of the code is not done, meaning ...
6
votes
1answer
164 views

Emails, emails everywhere

My job entails me to send a lot of emails. I'm really bad at typing so I decided to create a program to do it for me. I've created an email generation tool (originally posted here.) I've changed ...
6
votes
1answer
46 views

Coloured bash prompt including git status and previous exit code

I wanted to create a short, informational and colourful prompt. My prompt includes: Exit status of last command (if not 0) Distinctive changes when root rsync-...
3
votes
0answers
26 views

Get only intended input from user through the console

I finally worked out all of the bugs in this bit of code. I'm pretty proud of it and I wanted to give it to all of you so that you could have it if you wanted it for any console programs that you make....
4
votes
2answers
823 views

Minesweeper C++

This is my improvement of a minesweeper game I took from the internet, which I am quite proud of. Nevertheless I am willing to hear your opinions, suggestions, and comments. ...
9
votes
0answers
95 views

Using argparse module within cmd interface

I've created an application that uses a cmd interface. It has multiple levels, and the number of available commands and their complexity is growing. As such, I need to generalise argument parsing - of ...
0
votes
1answer
52 views

How to flatten multiple nested node readline questions?

Say I'm creating a simple CLI. I want to use native node readline module to take in some input from user at prompt. I thought of this : ...
3
votes
3answers
59 views

Console Worker Follow-Up

A few hours ago I posted a similar question but this is a follow-up, I have revised the code and added and removed certain lines of code and hopefully improved it a bit, I just brought it here for a ...
2
votes
2answers
38 views

ConsoleWorker update console timer with how long application has been open

earlier I coded a quick console worker that runs a timer every 1 second and updates the consoles timer with how long the app has been open, how can I improve this? ...
5
votes
3answers
131 views

Console RPG - show cycle optimization

I have this RPG game and this has elements such as the map, the monsters and the items. The monsters and the items are stored in Lists and every time I want to show ...
3
votes
1answer
79 views

Connect Four in Java for two human players

Connect Four kinda caught my eye, and I decided to start from the very basics. Here I have bare-bones implementation for playing the game between two human players on the command line: Board.java <...
1
vote
2answers
32 views

Countdown Timer for Tests

I created this countdown timer as a tool to count down the remaining time on a test a few months ago. However, I looked at the code today and it looks like it needs some improvement, but I'm not sure ...
4
votes
2answers
81 views
2
votes
1answer
119 views

Moving files while preserving the folder structure

I'm writing a console application that will look through a directory and move any log files that have a date modified older than X days (configurable in the ...
7
votes
1answer
161 views

Basic C# calculator code

I have not had any experience with coding before, and after beginning to learn I stated working on this calculator which runs different functions on the console. I'd like to hopefully be taught what I ...
2
votes
2answers
109 views

Simple TicTacToe game in C++

I just started learning C++, and this is one of my projects. It's just a simple 2-player (No AI) TicTacToe game that runs from the console. The project was to familiarize myself with arrays, so review ...
4
votes
1answer
163 views

Getting keyboard input for real-time console application

I've been building an IDE using C# and only the console. To get keyboard input in real time (as opposed to a read–eval–print loop,) I have the following method to get keyboard input: ...
4
votes
1answer
95 views

Minimize the console window to tray

I have a small console application that runs a very long task and I would like to hide the console window when I click on the minimize button but keep a notify icon in the system tray so that I would ...
7
votes
2answers
209 views

First C# program (Snake game)

I've just started out using C#. I've used Scratch (drag and drop programming for kids) for quite some time. Since Scratch didn't have classes and methods I have a feeling this code could be a lot more ...
3
votes
0answers
28 views

Write to terminal and buffer

...
2
votes
1answer
106 views

C++ Console variables

I've written some code for console variables. They support different types e.g. integer, string, vector, float, etc. Is there a better way to do this? Like with an interface and a class for each ...
3
votes
1answer
29 views

Displaying a table of shell aliases

I'm just getting into bash and sh scripting. I mostly just stub out little convenience or exercise scripts for myself, but I recognize I may be flaunting best practices at times. My question is ...
6
votes
2answers
407 views

First program: a simple calculator

I'm reading this very good book, C# Player's Guide, to learn C#. I then plan to make video games with Unity 3D after. In one of the chapters, he asks us to make a (really) simple calculator as a ...
2
votes
2answers
128 views

png2jpeg, a utility for converting PNG to JPEG (rev. 2/3)

Revisions: Revision 1 Revision 2 (you are here) Revision 3 png2jpeg is a simple command-line converter of PNG to JPEG. The source code requires the libpng and libjpeg development libraries to be ...
2
votes
1answer
215 views

C# console roulette game

I made a C# console roulette game. Check it out and give opinions on how to improve or ideas for some other features? It's not finished yet so it has lots of room for improvement. I am very new so ...
3
votes
1answer
87 views

A Java library for formatting console output

In perl, there is that format facility for console output. I thought it might be good to practice some library design instead of algorithms once in a while. This may be compared to a GUI library: you ...
7
votes
2answers
231 views

png2jpeg, a utility for converting PNG to JPEG (rev. 1/3)

Revisions: Revision 1 (you are here) Revision 2 Revision 3 I've been working on a simple command-line png2jpeg utility. Its purpose is to convert images from PNG format to JPEG. The source code ...
4
votes
1answer
30 views

Prompt system from reading a text file

I worked starting from basic example code from an exercise in chapter 10 of Java: A Beginner's Guide, Sixth Edition, the code in the exercise was not very good and I wanted to improve upon it and make ...
2
votes
2answers
44 views

Copy directory to multiple directories - I/O performance matters

I am working on below python copy utility that should work on windows & linux, But I am looking for a more efficient approach that could optimize my I/O correction, as my target location is ...
3
votes
1answer
61 views

Template for PHP service (/etc/init.d) script

I wanted a template for a service script that is versatile and easily configurable. Along with producing similar outputs to the SSH and Samba daemons, I request the code to be as clean, simple and ...
1
vote
0answers
57 views

A command line Java program for computing grade point average - follow-up

(See the previous and initial iteration.) I have refactored the API based on excellent review by cbojar. Also, a honorary mention goes to janos for pruning some unnecessary code out of the transcript ...
7
votes
3answers
109 views

A command line Java program for computing grade point average

(See the next iteration.) I have this command line program for computing GPA (grade point average). Given credit sequence \$\langle c_1, c_2, \dots, c_n \rangle\$ and grade sequence \$\langle g_1, ...
5
votes
2answers
86 views

Coloring a string in a terminal

I have this code which makes it easy to color a string in terminal but it is looking really repetitive. Is there a more idiomatic way of writing this? Also is there a functional way of doing this more ...
5
votes
1answer
179 views

Text-based Dungeon Crawl game

This code is an answer to an exercise I found on the cplusplus forums. I'm a beginner so any reviews will be appreciated :) Make a program that outputs a simple grid based gameboard to the screen ...
7
votes
2answers
53 views

CLI Twitter client in Python

Here is a simple client for Wwitter that I wrote based on the twitter library in Python. The aim is to be able to read the feeds from different twitter accounts ...
2
votes
1answer
166 views

Interactive command line YouTube downloader with option to burn subtitles into video

This is only used on Mac machines. I know that there is a Python implementation of youtube-dl and several for ffmpeg, however I chose to use subprocess so that I can see the real-time stdout/stderr ...
4
votes
1answer
92 views

Application for encrypting and decrypting files in Java - follow-up

(Everything needed for running the app is here.) I have refactored my previous version a bit. App.java: ...
3
votes
1answer
228 views

Application for encrypting and decrypting files in Java

(See the next iteration.) I have that application for en-/decrypting files. Here, I will post the actual GUI and command line code. In order to run the program refer to this GitHub repository. Some ...
4
votes
1answer
59 views

File creation program

I have written a program that is very simple, with a very specific purpose. However, having written it in approximately 2 hours, (with a bit of cut/paste from some of my other programs and MSDN) it's ...
2
votes
1answer
36 views

Bash script menu

Any comments on this? Like there is a way to get rid of all the if-statements or a better way to # check model and build (which ...
5
votes
2answers
260 views

First Tic Tac Toe game

I've been learning Objective C for a few days so to test my skills I went ahead and made a simple Tic Tac Toe game using the console. I already have some experience with languages such as C++, Java ...