A mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.
0
votes
0answers
4 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
2answers
42 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
28 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
124 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
72 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
27 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
70 views
Simple C# application that transfers new files (modified in the last 24 hours) from one directory to another
I'm new to C#, so I'm eager for any and all criticism/advice.
...
2
votes
1answer
77 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
131 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
104 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
133 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
61 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
185 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
25 views
2
votes
1answer
103 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
28 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
296 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
125 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
132 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
62 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
227 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
50 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
53 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
95 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
84 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
123 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
51 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 ...
1
vote
0answers
132 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
83 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
148 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
58 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
34 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
224 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 ...
2
votes
0answers
408 views
Execute commands over Telnet, logging to a file
I have made some code that will login to a device and send all your additional commands. It also logs the commands and the returned values to a file on the local system.
Hope somebody can tell me if ...
3
votes
2answers
44 views
Constraining stdin in Python, v2.0
Rags, again.
This is the rewrite of Read stdin like a dictator.
From that post:
All too often I find myself wanting to allow only a certain list of characters to be written to stdin, and only ...
4
votes
2answers
99 views
Colorful output on terminal
I went from manually outputting escape codes in each string to creating a utility struct/class full of static functions and variables that needed to be initialized in source files (static private ...
4
votes
2answers
82 views
Un*x terminal history wiper
Using various answers from Stack Overflow and Ask Ubuntu, I've hacked together this simple C program that wipes terminal history. It works but I'm relatively new to C so I'm not sure if everything is ...
4
votes
3answers
229 views
Filter column and row according to regex in header
I'm writing a script that can grep the rows and columns from a text file that match a regex. I have an implementation but I'm looking to make it more elegant.
input.tsv
...
2
votes
1answer
171 views
Connect4 With AI
I have made a connect 4 console application in C++ and would love some feedback. In this project I have learned about inheritance and using virtual functions.
Main.cpp
...
6
votes
2answers
251 views
Command Prompt TicTacToe in C#
I wrote a basic command prompt Tic Tac Toe Game. I want to know what can be improved in terms of modeling and what mistakes I've made (if any).
...
3
votes
1answer
63 views
Terminal ESC Sequence Decoder
The goal of this code is to read-in a stream of terminal ESC sequences, and break them down and fill a vector of parameterized sequences for processing later on.
For example ...
6
votes
1answer
110 views
Read stdin like a dictator
Rags.
Introduction
All too often I find myself wanting to allow only a certain list of characters to be written to stdin, and only recently did I actually ...
5
votes
3answers
758 views
Dr. Nim game in Java
This video should explain how the game works, but in simple form, it's a game where you enter a number between 1 and 3, This number is than removed from 12, in doing so the computer will then pick a ...
4
votes
1answer
56 views
JavaScript (ES7) LOC counter
I've been writing JavaScript for a couple years but nobody's ever really looked at my code.
This is a small library I wrote to check code modularity, w/ input like ...
62
votes
6answers
10k views
How clean is my snow?
I just wrote a snow animation in Python. I think this is fairly clean but I have a few things that I don't like.
...
4
votes
1answer
131 views
FFmpeg command line for showing two videos side by side
Here is command line for playing two videos side by side in sync in FFmpeg (ffplay). It can be useful for comaring videos, for example.
...
7
votes
1answer
220 views
Connect Four - Console Application
I have attempted to make the classic game Connect Four in C++, and I would love some feedback on this project. I have done everything myself without using the help of a tutorial or guide, so sorry if ...
3
votes
1answer
161 views
Battleships console game
I have built a light version of a battleships program and would love for anyone to critique it. The game does not feature OOP, AI nor multiple boards. I aimed more for functionality than correct ...