Add this tag to your question to indicate that you are new to the language of your code. This will often be taken in to consideration by reviewers when assessing your code.

learn more… | top users | synonyms

1
vote
1answer
21 views

Stanford CS106A Min / Max program

I am learning Java through Stanford CS106A and I'm wondering how the code for this early assignment looks. I've worked in a proprietary scripting language before and so I'm trying to get the right ...
4
votes
1answer
38 views

Guess the Number Game in Python

I have been using Python to learn programming, but I am just recently beginning to utilize classes. I have a basic game below. Please review and let me know what I should improve on. ...
1
vote
1answer
29 views

Terminal program engine

I wanted to create an example of developer-friendly, maintainable, expandable, reusable understandable module that could be used by other programmers even though it won't. Thus, I started developing a ...
0
votes
1answer
39 views

Creating an array length n * n, separating it into n groups, and adding numbers to it n times

I am completing the CodingBat exercises for Java. Here is the one I have completed just now: Given n > = 0, create an array length ...
1
vote
0answers
10 views

Number guessing game in Racket

I decided to learn a Lisp-ish language and I am discovering a very weird and new sintax. The obligatory first programme, that also uses all the fundamentals is the number guessing game. Did I ...
5
votes
2answers
45 views

Transposing a 2D array

Would you have any suggestions for improvements for the code below? ...
2
votes
0answers
25 views

MD5 hash comparison for two folders

Using this page for a starting point into comparing MD5 hash values from files in two different folders, I've put something together that outputs either Copied if ...
7
votes
4answers
186 views

Identifying array elements, rearranging them, and replacing them

I am completing the CodingBat exercises for Java, and, having learnt from the answers to the previous one, I completed the one that follows: Return a version of the given array where all the ...
1
vote
3answers
67 views

First full Tic-Tac-Toe program [on hold]

This is a Tic-Tac-Toe game that I recently began working on. Note: I am new to C++ and programming in general; I have only been coding in C++ for a few days now. I decided to make this program to see ...
6
votes
3answers
128 views

Swift iOS - Call back functions

I'm working on an iOS app which handles API request based on authentication. Authentication is done through OAuth and every API request is sent along with ...
5
votes
3answers
219 views

Rearranging array elements depending on their indexes

I am (still!) going through these CodingBat exercises for Java. Here is the one I have just done: Return an array that contains the exact same numbers as the given array, but rearranged so that ...
6
votes
1answer
66 views

Python text game

I've written a simple text game in Python to show you. I would be glad if you would spare a quick look and point out the style errors so I wouldn't pick up bad habits. ...
3
votes
1answer
70 views
2
votes
5answers
211 views

Return true if the elements of an array do not contain one or the other

I am gradually completing the CodingBat exercises for Java. Here is the one I just did: Given an array of ints, return true if it contains no 1's or it contains no 4's. Here is my code: ...
1
vote
2answers
28 views

Identifying numeric substrings of an alphanumeric string, and summing them

I am going through the CodingBat exercises for Java. Here is the task I have just completed: Given a string, return the sum of the numbers appearing in the ...
10
votes
6answers
3k views

Given two int values, return the one closer to 10

I did the exercise below to practice. Can someone help me to shorten or improve the code in a simple way for a beginner? The exercise is: Given 2 int values, ...
2
votes
2answers
28 views

Returning matching substrings, of n length, at the beginning and end of a string

I am going through the Java CodingBat exercises. Here is the one I have just completed: Given a string, return the longest substring that appears at both the beginning and end of the string ...
6
votes
4answers
330 views

Summing digits of an alphanumeric string

I am going through the Java CodingBat exercises. Here is the one I have just completed: Given a string, return the sum of the digits 0-9 that appear in the ...
7
votes
4answers
959 views

Locker Puzzle in Java

The author of my book does not release odd-numbered solutions to students, so I can't check my solutions. I was wondering if there was a better way to solve this problem without simply printing out ...
2
votes
1answer
54 views

Cinema scheduling

Even though I have asked a question here related to my app using Swing and creating JPanel, I still have other ones about best practice making applications. I'm ...
6
votes
1answer
63 views

Moody game characters

I've been doing some self-imposed exercises to get accustomed to Python and below is my code. ...
4
votes
1answer
35 views

Reading in a series of Excel files

I needed to create a program which reads in a series of Excel files in folders typically structured something like this. ...
4
votes
1answer
229 views

Huge terminal game (in development)

I'm developing a big (for me, as a beginner) terminal program "Brainfuck - The Game", in which you have to complete Brainfuck challenges. I would like your review on existing code (and project ...
3
votes
1answer
45 views

User search controller

I am using the ruby sunspot gem to create a search users function on my site. It works fine and the users controller for the index page where there is a search form is this ...
4
votes
0answers
76 views

Tic Tac Toe in JavaScript

I'm a beginner and just finished my first Tic Tac Toe program. I was looking to get some feedback on some of the portions that seem a bit repetitive. Is there a way to make this more dry vs. hard ...
-1
votes
1answer
27 views

Optimizing jQuery/JS Switch Statement

I am trying to optimize the following switch statement, but I'm having a brain fart about how to do it. Here's the code: ...
1
vote
1answer
25 views

Calculates and Generates student report card (Part 2)

I've updated my code according to some tips from a previous post and would like to post the new code for review. ...
4
votes
3answers
57 views

Case insensitively removing a substring, efficiently

I am going through the CodingBat exercises for Java. I have just completed this one: Given two strings, base and remove, ...
10
votes
2answers
932 views

First OOP in C++ - Car example

A code challenge between some friends, as I came from a Procedural way of coding, instead of using Objects. The paramaters are below: store the properties of a car colour make model ...
1
vote
4answers
94 views

Redacting everything in a string except a particular word

I am working through the Coding Bat exercises for Java. Here is one I have just completed: Given a string and a non-empty word string, return a version of the original String where all chars have ...
6
votes
2answers
188 views

Removing Asterisks and neighbors from a string

I am going through the CodingBat exercises for Java. I got to this problem: Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its ...
1
vote
1answer
40 views

Counting only weekend days between two timestamps

I am fairly new to the Groovy arena. I recently modified some code to add the following block. This code is added to remove dates we were supposed to remove from the total counts. This data goes on ...
5
votes
1answer
62 views

Haskell 99, Problems 1-10 (simple list processing)

I'm just learning Haskell and I wanted to know if I'm going in the right direction with my solving of the Haskell 99 problems. The file of interest is here which I've also reproduced below. ...
6
votes
3answers
234 views

Remove blank entries from row

I wrote a sub to remove the blank entries in a row without shifting the cells around but it seems unnecessarily clunky and I'd like to get some advice on how to improve it. ...
4
votes
1answer
52 views

Small “Pyramid Escape” text-based game

I'm extremely amateur when it comes to C++ in general, but I wanted to make a little "Pyramid Escape" text based game. I'm not done whatsoever but before I continue I want to see what I could possible ...
4
votes
2answers
99 views

Calculating and generates a report card for a student

I'm working on this small program for practice and would like to know how I could improve it from here. I'm still a relative beginner with C++ and would like to know if there is a better why to design ...
1
vote
1answer
61 views

FPS efficiency for 'attack counter'

I have a code snippet which I wish to improve to increase my program's FPS, but as a beginner in JavaScript, I do not know how. I know the problem, which is the fact my counter mechanism used to delay ...
2
votes
2answers
53 views

Use Selection Sort to Sort Employee Data About Pay

This program is supposed to prompt the user for hours and wage of 4 employees. Then the program will use a selection sort to sort the data into ascending value using the wages. The information like ...
7
votes
1answer
62 views

Small console app to execute some remote scripts

I'm learning F# and functional programming, from a background in C# and imperative/OOP. I've ported a small, one-off console app from C# to F#. The port worked (the app behaves the same way), but I'd ...
4
votes
2answers
38 views

Simple Ruby directory navigator functions

In the process of writing scripts to work with CSVs and other files of the like I found myself in the need of a way to navigate and select files for various purposes. I wrote the following function ...
2
votes
2answers
169 views

Array of immutable objects initialized at compile-time

I have a class that contains defines 'magic' numbers at compile time such as basic array sizes, fixed ip address, etc. so that I have one place to edit if changes are required. In this nested class I ...
1
vote
0answers
31 views

Action Event and checking buttons

I am creating a simple program with multiple buttons. Is this way of checking which button was pressed is ok? Is it better to use switch..case.. statement? ...
4
votes
2answers
34 views

Network arithmetic, finding the next host for the given

Disclaimer: It's literally the second time I write in Haskell. The purpose of this module is to provide some basic operations with IP addresses (and networks). At the moment I only implemented the ...
1
vote
2answers
59 views

Possible sub-optimal selection sort

Why is this code "bad"? In all of the selection sort codes I am learning from, they do it much differently. I will learn the proper code from the book, but I would love to know why this particular ...
6
votes
4answers
223 views

Create a 2D array from SQL table

I am a beginner to PHP programming. I wanted to make a 2D array that would store the values of a table into the array. Below is the Frankenstein code I created (every time I wanted to achieve a task ...
5
votes
1answer
68 views

Reading a matrix and computing the determinant

As one of my first C programs I want to read in a matrix and compute its determinant. I don't pose limits on the size of the matrix and this makes things more complicated. Version 0 ...
4
votes
1answer
71 views

Using swing and creating JPanel

I watched bunch of videos about swing and GUI in general and created my first component (correct me if it is not one). JPanel class: ...
6
votes
4answers
145 views

Summarizing calories for a food diary

I'm new to C and I've been working on some code for a project for school. This was the finished result and now that I'm done it, I came back and tried making it better. So I was wondering, how would I ...
8
votes
7answers
385 views

Music Theory Website

I was just curious to know what you think about this website I'm designing. I would just like any constructive feedback that you might have. http://jackatron.web44.net/music/ ...
1
vote
0answers
16 views

Matlab bins with two features: calculation and plotting

I have the following code in Matlab, which is supposed to do what I asked in this SO question. The idea is to: Divide the temperature deadband of each agent (they are different between agents) into ...