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

learn more… | top users | synonyms (2)

3
votes
3answers
282 views

ATM Console Program

I decided to write an ATM program in my favourite programming language, C#. Tested with a few numbers and I am confident it will give correct output for any valid input: ...
1
vote
1answer
31 views

m3u file collector

I'm new to Python and wrote this code for collecting all files in an m3u (playlist) file and copying them into a directory. ...
3
votes
2answers
79 views

Bash script to capture error message and change exit status

I'm working with the Perforce command line client. I ...
2
votes
0answers
26 views

Scala - Console User Interface Framework

I've been learning Scala and I'd love to get your feedback in order to improve. As an exercise I made a simple framework for creating command-line user interfaces. Any and all comments are welcome, ...
2
votes
0answers
49 views

General Tic Tac Toe with Alpha-beta pruning in Java

I like toy AI and what can be better than starting from Tic Tac Toe. Basically, this is a command line program that asks the user to input the height of the game field, the width of the game field, ...
3
votes
0answers
38 views

Simple REPL command parser in Java

I have this tiny library for implementing simple command line languages. It is not flexible enough for handling actual programming languages, but hopefully it may help implementing simpler REPL's ...
2
votes
3answers
307 views

Determining if a possible new entry already exists in a dataset

For example, if I have the following data table layout: ...
6
votes
2answers
65 views

Ruby command line Mastermind game with AI

I've created a small command-line 'Mastermind' game using Ruby. The intent of the project (aside from having fun in the build!) was to learn and emphasize OOP concepts and principles. The game has ...
1
vote
2answers
164 views

Accepting a positive integer from either a command-line argument or System.in

I've been doing a lot of programs for classes that require a prompt from the program. I thought it would be much faster for me to rapidly test inputs if I didn't have to execute the program and then ...
5
votes
1answer
503 views

Design patterns for console commands

I've made a pretty standard console in which you type a command and it does something. However, the issue that comes to my mind is scaling: if I want to add hundreds of commands, I have to manually ...
3
votes
1answer
48 views

Binary Bayes network classifier in Java - Part I/II - follow-up

TERMINOLOGY We are given a directed acyclic graph (dag) \$G = (V, A)\$, where \$V\$ is the set of nodes and \$A \subseteq V \times V\$ is the set of directed arcs, and a weight function \$p \colon V ...
10
votes
1answer
142 views

Binary Bayes network classifier in Java - Part I/II

I was working on the binary Bayesian network classifier I asked about earlier. See also Part II/II. See also the next iteration of Part I. TERMINOLOGY We are given a directed acyclic graph (dag) ...
0
votes
2answers
49 views

Argument parser for a word count and/or line count program

How to make code dry in this example? My program is working, but I want to improve it by shorting my code. . ...
6
votes
2answers
92 views

Simple console snake game in Python

Here's a simple snake game I implemented in Python, which works in a console. It's not complete yet (doesn't generate food yet, and no scoring or difficulty levels), but it works. I would be really ...
5
votes
1answer
123 views

Terminating an Active Directory user

I'm writing an AD Termination script for work. I'm new to PowerShell and was wondering if multiple commands within PowerShell switch statement is okay to do: ...
3
votes
0answers
62 views

Converting uploaded video and saving preview images

I'm coding a basic video upload system for a client. The uploaded videos will live on the page using the HTML5 video element. Essentially what I've done is call the following PHP script ...
19
votes
5answers
2k views

A completely repetitive console prompt, a completely repetitive console prompt

So I wrote this for my Mandelbrot Generator, to collect and use input from the user, and I made it dynamic enough to be useful anywhere. I'm really interested in all critiques of it, as I'm going to ...
3
votes
3answers
179 views

Loop at specific folder in outlook to look for specific title

I created a C# console program to loop through a specific folder in Outlook to look for a specific email subject. When I run it on my computer (multi-core CPU), it didn't use up 100% of the CPU ...
5
votes
2answers
207 views

Prompting for five test scores and printing the average

I am not sure how to properly make this readable. I have been trying to find examples online but I cannot find any that are specific to this simple program. ...
5
votes
2answers
189 views

Print output one word per line - K&R Exercise 1-12

When writing this code I found myself getting more and more complex. When I got to the solution I trimmed the excess parts I'd thought I needed from before, but didn't actually need. The example of ...
13
votes
2answers
476 views

Full C++ Snake game

I managed to finish my approach on the legendary Snake game. You move around with the WASD keys. I would like to hear your opinion and maybe ideas on how I can improve frame rate because now it sort ...
2
votes
2answers
92 views

Hangman game school project

This is a school project and took me a while to write the code. Any help to improve my code is welcome! ...
7
votes
1answer
119 views

Console Calculator in C#

This is a calculator I've made in C#. Is there any way to improve it? Surely there is a way to get rid of all the ifs that are nested inside one another. ...
12
votes
1answer
163 views

Racetrack in Java

Racetrack: The August community challenge is to implement a program that plays the Racetrack game. Each player starts with an integer position on a square grid. On each turn, the current player can ...
6
votes
1answer
75 views

ANSI colors cross platform

I am trying to write for both NT and POSIX (my two usual platforms) and have come up with the code below. The clrs code I refer to is apparently from blender build ...
6
votes
1answer
67 views

printf-style string formatter

As part of a larger project I'm working on, I've made a function that aims to replicate, as best as I can, the placeholder part of the console.log() function usable ...
2
votes
1answer
57 views

Diary Application with accounts (v.2)

Folow up of diary-applications-with-accounts Diary Class ...
9
votes
1answer
123 views

A low tech approach to measuring game speed

Whilst developing a game I needed a delay routine capable of doing delays ranging from 0.5 sec to just a few msec. The obvious choice was to use the BIOS delay function 86h on int 15h. In a true real ...
10
votes
5answers
1k views

Marijuana information program

I made a simple marijuana information program in which I give the user a list of strains and give the user information about it, like: effects, medical, negatives, and its cannabis type ...
-1
votes
1answer
157 views

Console-based Rock-Paper-Scissors game

I just began my C# debut and was just wondering if this Rock-Paper-Scissor console app is good and flexible. ...
3
votes
1answer
71 views

Pass the password back

This code simply receives a very basic 'password' (numbers, letters, nothing fancy). After you press enter, it will display it back. The only special key I'm handling is backspace (code ...
4
votes
1answer
28 views

Simple local source control - Part 2

I've refactored the previous version of my local source control, and revised a few things. It's mostly the same, but there are a few minor differences, like the argument separator, one new command, ...
9
votes
1answer
43 views

Simple local source control

I've written my own local "source control". Rather than using a commit-based system, when you're ready to release a version, you can run a command which will create a ...
8
votes
1answer
96 views

Snake game for Windows console

I would apreciate any suggestions on how to make my code better and more efficient. ...
3
votes
2answers
326 views

Quadratic equation solver

I started Python 2-3 months ago, but I really haven't done much since then, just little things. Yesterday, I wrote this simple quadratic equation solver. You can give \$a, b\$ and \$c\$ any value, but ...
12
votes
2answers
744 views

Console-like printing of message JavaScript

I'm learning JavaScript and I've made a very simple little document-modifying script that prints a message as if it was someone typing into a console. It practices recursion and in my opinion, I feel ...
7
votes
2answers
107 views

Finding cost of tile to cover W x H floor

I am new to C++ and programming in general. After reading through my first book, I decided to take on some programming exercises and test what I learned. The exercise is phrased as follows: Find ...
6
votes
1answer
75 views

Windows CLI locks killer in Python

Some coworkers and I sometimes want to delete folders, only to get the very informative: "Permission Denied" message. I had discovered Handle.exe and Process Explorer to help with this, but the method ...
8
votes
3answers
484 views

Snake-like console game

This is what I came up with when trying to make my first console game. I think it turned out quite okay so I wanted to know what you think about it. If there is anything to improve, may it be coding ...
7
votes
1answer
62 views

Detecting two keys pressed in quick succession

My computer has been having this issue where when I press a key, two key presses get registered. The goal of this program is to detect the time delta between the two keys so that I can set an ...
8
votes
2answers
92 views

Fine tuning of an informative replacement for rm

I want to replace rm by a more informative variant: I would like to see which files will be deleted, along with their size, and I would like this information to use ...
11
votes
7answers
1k views

Scoring a Scrabble Word

I was asked before an interview to create a console application that will work out the score of a word for the board game scrabble. It worked fine but the feedback I received said: "there were no ...
4
votes
1answer
94 views

Tic-Tac-Toe command line

I created a simple Tic-Tac-Toe. I'm looking for any critiques from a code standpoint: general structure / style / efficiency. Unfortunately I couldn't get a live demo working because of the ...
5
votes
2answers
145 views

Generic Networking Class for PHP

I am in the process of writing networking code for PHP that is meant to be used in long-running PHP processes. I realize that PHP is supposedly not well suited for long-running processes, however ...
6
votes
2answers
69 views

Jar console application serializing key-value pairs based on specific commands

I was assigned a task to make a simple jar that can handle 2 console commands -> create key value, read key. I have 4 classes, where my main logic is implemented. Eg. ...
4
votes
1answer
137 views

Daily Desktop Background

I've created a simple command-line program that downloads the Bing Image of the Day, then sets it as my desktop background. It is a console application, and closes immediately after setting my ...
6
votes
2answers
158 views

Bank ATM program in Ruby

After reading a bunch of Ruby tutorials, I decide to write fake ATM bank software. I've tried to use OOP design and just want to know if I'm on the right road. ...
5
votes
4answers
853 views

Basic OS login program

I have just finished the sololearn C++ course and wanted to create a basic login program in the vein of a basic operating system. ...
4
votes
3answers
410 views

Handling arrow keys for a console menu

I have a relatively long method, and I'm wondering: How readable is it? Is a method this long okay, or will it be bad later on? Note: This method enables users to select from a console menu - ...
1
vote
1answer
53 views

Exception handling for a chain of prompts

I am trying to make an inputin() function to take all the parameters input for the first time with exception and for individual parameter for the runtime ...