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.
1
vote
0answers
24 views
Project Euler 54: Winning Poker Hand
The problem can be found here.
The file, poker.txt, contains one-thousand random hands dealt to two
players. Each line of the file contains ten cards (separated by a
single space): the first ...
-2
votes
0answers
13 views
White gap on right side of webpage? [on hold]
I've literally been looking for an hour now, stumbled on this site, tried a bunch of different solutions from other topics and haven't gotten anywhere. If anyone can help me out, you would be my ...
4
votes
1answer
68 views
Computation of product of permutations
Given a graph \$G = (V,E)\$ with a unique labeling of each vertex, let the transposition \$(i,j)\$ (where \$i,j\$ are the labels on adjacent vertices) represent selecting an edge and swapping the ...
7
votes
1answer
720 views
Bash script to simplify Git deployment workflow
In my company I follow the following workflow. (I think it can be defined a kind of 'Continuous Integration'.)
Workflow:
We have 3 fixed branches (...
1
vote
0answers
14 views
Formatting a CHANGES text file as HTML
I have a function which is used to convert text (a CHANGES file) into HTML for reading. The function is essentially line-based: if the line is of this type, do this thing; if some other type, do that ...
0
votes
1answer
37 views
Partitions of a number (backtracking) - time efficiency
I had to write an algorithm that prints the partitions of a natural number in lexicographic order. Example of I/O:
If the algorithm reads from ...
-1
votes
0answers
26 views
Portfolio Pro's and Cons [on hold]
My names Tobi, I'm 16 and am super interested in pursuing a career in computer science. I created a 'Portfolio' page that I hope to fill up over the years, I wanted to know how it compares and if it ...
3
votes
2answers
66 views
War card game using classes
I would like some feedback to the code I wrote for the card game War. While programming it, I wanted to make classes that I could easily use for other card games too (hence why some functions are ...
5
votes
3answers
126 views
Simple calculator in C#
It is a basic calculator where the user inputs two numbers, and an operation and the program makes it into an equation and gets the answer. For example, if the user enters number 2 number 3 and tells ...
3
votes
1answer
44 views
Beginner code for a text-based battle simulator
I wanted to see if anyone would like to review the existing code I have for a beginner program that simulates a battle. I have learned a heck of a lot while doing it, and I had a few questions ...
5
votes
2answers
89 views
Longest palindrome in an array
I am new to programming, and think this code could be improved upon. Any suggestions?
...
5
votes
1answer
48 views
CodeWars Solution to “Simple Elevator”
I am new to programming (less than a year), and I would like to improve.
I solved a problem on CodeWars and copied both my solution and the top voted solution below. I listed specific questions after ...
9
votes
4answers
269 views
Basic Calculator - Takes 2 numbers and does an operation with them
I was wondering if anyone has any suggestions to improve my code. The code works perfectly fine for me (compiled it in BlueJ and Eclipse) but I was wondering what other more experienced programmers ...
3
votes
1answer
39 views
Number guessing game in Kotlin
Is this code missing any "Kotlinisms"?
I've just started learning Kotlin so I'm not yet familiar with the Kotlin way of doing things.
The program will guess a number you are thinking of.
...
4
votes
0answers
19 views
Multiple rusty Sieves of Eratosthenes
To get more familiar with the multi-threading aspects in the Rust language I decided to multi-thread my earlier implementation of The rusty Sieve of Eratosthenes.
I have to say that it is probably in ...
3
votes
3answers
55 views
Project Euler Problem 11: largest product of 4 adjacent numbers
I am a fairly beginner-level programmer, and I have been working through the Project Euler Puzzles. I am currently on Problem #11, which asks to find the largest product of four consecutive numbers ...
5
votes
1answer
19 views
Cleaning up Erlang code for a text editor
On Monday and Tuesday I started learning Erlang through the Erlang Koans, and around Wednesday night I decided to use my newfound knowledge to implement a simple text editor (Akin to ed(1)). Currently ...
0
votes
0answers
33 views
6
votes
2answers
52 views
Implement a generic Fibonacci sequence in Rust without using Copy trait
I'm trying to learn Rust and am a beginner. How does one go about implementing a generic version of the Fibonacci sequence without using Copy trait in Rust? My code ...
3
votes
4answers
44 views
Verifying that all form fields are filled in
I grabbed the form from some random site because I'm only interested writing the javascript at the moment.
I am trying to check that a user has selected or entered text for all fields. I've made it a ...
2
votes
0answers
39 views
Parse long string in Go
I'm sure that my server can work with better performance, but it's just a dream.
Parsing a very long strings is not so obvious task for me.
I have a server that handles a lot of clients requests and ...
3
votes
0answers
57 views
Scraping the date of most recent post from various social media services
Task
I have a large spreadsheet where each line should include:
The URL of a social media account
A field indicating whether the account is "active"
A name and UID number for each account
I have ...
5
votes
1answer
53 views
Python code for Mad Libs
I am a beginner with only about 2 months under my belt. I'm learning Python 3 using the Automate the Boring Stuff with Python manual. In the chapter on reading and writing files one of the exercises ...
7
votes
2answers
180 views
Let's play Rock, Paper, Scissors
I have written my first rock, paper, scissors project recently. I had to use a lot of if statements and System.out.println(); commands in the program. I am wondering what ways I could optimize my ...
11
votes
2answers
1k views
Using Fibonacci sequence to generate musical melodies
I recently started picking up the Haskell programming language. I've managed to learn other languages rather quickly, but I'm still having a difficult time grasping some of the basics of Haskell.
I ...
2
votes
2answers
40 views
Selecting one form to be visible using jQuery
I'm new to JQuery but have managed to get it working the way I want. The problem is, it's a bit convoluted and could easily get out of hand if I add more options.
I am trying to show and hide divs ...
0
votes
0answers
13 views
Refine a web page that Outputs video from my gate & keeps a log of entries [closed]
I have a remote opening front gate on my driveway that can also be opened and closed by wifi from my phone.
The whole thing is run by several Raspberry Pi's that was mostly set up by my brother when ...
3
votes
2answers
58 views
A Car Rental Agency - guaranteeing uniqueness
Just looking for some constructive (harsh) criticism of a project I've completed and handed in. This is a theoretical implementation of the system, specifically has a simplified registration number ...
4
votes
1answer
100 views
A very basic JavaScript calculator
I'm just starting out with code. I created a very basic JavaScript calculator.
While writing, I couldn't help but think that there must be easier, faster and less redundant ways to write this. For ...
43
votes
3answers
7k views
Monopoly simulator
I was advised by a Reddit user to get my code reviewed on this site.
The complete code is on GitHub.
...
6
votes
1answer
107 views
The rusty Sieve of Eratosthenes
To get familiar with the Rust language I've decided to implement the method of Sieve of Eratosthenes to find primes up to a number N.
I have created the following code that both prints the prime ...
5
votes
2answers
195 views
Palindrome evaluator in C++
I started learning C++ a few days ago, and this is my first full program. It takes in words until an end-of-file character prompt is given, and then outputs which of those words are palindromes and ...
3
votes
2answers
74 views
Beginner code for a Rock, Paper, Scissors game in Python
I am a beginner in Python and I wanted to see if I could get some feedback on my simple Rock, Paper, Scissors game. I do have previous experience in programming, as I started learning a few years ago ...
3
votes
1answer
93 views
4
votes
1answer
39 views
Count words in string and tally up the repetitive words
I'm an elixir beginner. I'm doing the word count exercise of exercism website. The word count exercise returns a map with the word as the key and the number of instances as value. The exercise ...
1
vote
1answer
61 views
CUDA brute force 48 bit key
I have a cryptographic function with two 24 bit keys.
I have two blocks of input and two blocks of output, and want to brute force the keys using CUDA.
Overview:
The function is composed to two ...
1
vote
0answers
37 views
5
votes
0answers
26 views
Pomodoro timer in Go
My goal is to implement a simple pomodoro timer using Go: channels, goroutines. I'm newbie in Go world and have some misunderstanding about naming convention. I read a lot of Docker's code on GitHub ...
1
vote
1answer
37 views
Simple four-operation calculator in Lua
I'm a beginner at Lua and programming in general and I just made a simple calculator and I was wondering where I could make improvements.
...
8
votes
1answer
71 views
Small Python class for Lindenmayer Systems
L-systems are basically rules for recursively rewriting a string, which can be used to characterize e.g. some fractal and plant growth.
I wrote a small class to represent deterministic L-systems and ...
3
votes
2answers
56 views
Exercise 1-22 from K and R: line folding
I'm currently learning C with K&R, i'm right now in the exercise 1-22, but it's a little... hard to understand (at least for me). It says:
Write a program to "fold" long input lines into two ...
1
vote
0answers
19 views
Practicing rogue-wave I/O
What I'm doing:
Searching in current directory for a set of files.
Filtering the set.
Searching through the filtered set of files for a specific line sequence.
Write to an output file that line ...
3
votes
2answers
202 views
Printing all prime factors of a number input by the user
I just started teaching myself to code a few days ago using the Euler problems. I finished a variant of problem 3: print the prime factors of a number input by the user. I just want feedback and code ...
5
votes
1answer
84 views
Koch snowflake in Python with numpy and pygame
I've drawn a Koch snowflake with Python 3. I'm new to the Python world and would appreciate all feedback on how to make the code more Pythonic as I'm not used to these idioms, styles and modules. All ...
3
votes
1answer
36 views
Aggregate cost for a directed graph in Prolog
I've come up with a simple graph traversal algorithm to calculate the aggregated cost of a directed graph or its subgraphs. Given a directed graph, the code visits all reachable nodes and sums up the ...
1
vote
2answers
89 views
Argument parser for a PostgreSQL backup utility
I'm sure it's still not yet perfect and tips will be greatly appreciated!
I just re-read the script and I realised I'm not handling exceptions! The script is unfinished but I'm looking for WIP (work ...
2
votes
1answer
78 views
Checking for vowels rewrite
A few days ago I posted a little program that would check for vowels within a given word. I have rewritten this program, it can only find vowels in the English language still but, it will now tell you ...
4
votes
2answers
86 views
My JavaScript calculator
I am playing a bit with vanilla JavaScript and created a simple JavaScript calculator using eval(). Any suggestions for improvements?
...
0
votes
2answers
50 views
Getting and posting data use PHP OOP and mysqli
I am not very experienced in php oop. Moreover, when mysqli comes with php oop, it make me more confused about using it in best efficient way. Anyway, first look at my connection class:
...
8
votes
1answer
121 views
Calculating word-wise CRC
This is a small program to calculate the CRC for an STM32 program image, compatible with the CRC on the STM32 hardware. It's a word-wise CRC, and the bin file is encoded as a series of 32 bit little ...