Questions tagged [beginner]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
82 views

Convert light-years to other representations

the code is very messy, long and I am looking how to shorten it and/or simplify it. There are a lot of repeated variables, for example; 'hourToDay' and then 'hourToDay1', 'hourToDay2' and so forth. ...
5
votes
2answers
95 views

Chip8 Emulator in C++

I wrote this chip8 emulator as practice recently since my coursework is mostly console programs. I've tested it with roms off Zophar's Domain and it appears to work with my limited testing. I'm hoping ...
2
votes
3answers
62 views

Beginner user registration and login program

I'm new to coding and C++, this is one of my first pieces of "software". Could anyone give me some constructive criticism? ...
6
votes
1answer
77 views

Custom HttpClient implementation for third part usage with sync/async calls

I'm doing an implementation of HttpClient that is built in a NET Standard project, which will be used as a base to build and process JSON requests/responses for a third part REST API. Client is built ...
3
votes
1answer
72 views

Apply a sepia filter to an image

I'm writing a simple function that applies a Sepia filter to an image. My function works, but I'm a beginner gopher. So I would like to know if there is a way to improve the code. I usually code in ...
1
vote
2answers
72 views

Reposition vertices at the origin of a coordinate system

This method repositions vertices of an object in such a way that the center of the object is at the origin of the coordinate system. The task is the commented part. While my code does the job I feel ...
3
votes
2answers
56 views

Fixed Content Necklace Generator

I wrote a class that generates combinatorial necklaces with fixed content as per Sawada: A fast algorithm to generate necklaces with fixed content. The class is instantiated with an input list that ...
5
votes
1answer
51 views

Implementing d-ary heap

I'm trying to Implement a d-ary heap. A d-ary heap is just like a regular heap but instead of two childrens to each element, there are d childrens! d is given when building a heap, either by giving an ...
1
vote
1answer
55 views

Adding a number to an array of digits

I'm a student in my first semester and in my free time and holidays, I do some java training to keep my mind from rusting...so I downloaded this amazing Digital Algorithms practice app and came across ...
4
votes
2answers
119 views

Reading Data from XML and storing them into SQL Database

I am developing a C# Windows forms application. In that, I am reading data from XML which is coming from a web API and storing that XML data into SQL database. I am able to achieve this. But my only ...
3
votes
1answer
65 views

Very simple Hangman game, with a Swing GUI added

I have just started learning basic Java. I would like to know what I can do to improve my coding habits in Java and how to code more efficiently. In this code example, I took code from Very simple ...
4
votes
3answers
377 views

Project Euler # 15 Lattice paths in Python

Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20×20 ...
1
vote
1answer
58 views

Project Euler # 11 largest product in a grid in Python

In the 20×20 grid below, four numbers along a diagonal line have been marked in red. The product of these numbers is 26 × 63 × 78 × 14 = 1788696. What is the greatest product of four adjacent numbers ...
2
votes
1answer
83 views

Simple console application that changes text color based on user input

I am learning C# like 1 or 2 months and I wanted to know if there is any possibility to shorten this code. It is simple. It only changes color of the console text with ...
6
votes
2answers
72 views

Basic console calculator with four operations

I'm an absolute beginner in programming, and Today I decided to put my knowledge to the test and create a basic c# calculator. I've Done it, but now I'm looking for ways to Make it more shorter and ...
4
votes
2answers
76 views

Draw an outline of an upward-pointing triangle

I am beginner in C++ and I was given this assignment by my teacher. The assignment is to print the following shape: ...
4
votes
1answer
126 views

A Basic Hash Map in Python

A hash map is a data structure that implements an associative array abstract data type using keys and values and has a hash function to compute an index into an array, from which the desired value can ...
2
votes
0answers
32 views

Code to configure “particle generator” from valid configurations options

My C++ code accomplishes the following: It consists of a class called ParticleGenerator which has three important configuration options: ...
6
votes
1answer
62 views

Haskell PitchClass Algebra, in which notes have various names

I am an OOP programmer by trade (Java) who is extremely new to Haskell and the world of purely functional languages. To get my feet wet, I decided to try and write a little musical interval translator/...
19
votes
6answers
4k views

Premier League simulation

I've created a simulator for the Premier League, which takes in all of the 20 teams and plays them against each other, recording the results and outputting a table at the end. The skill levels are ...
6
votes
2answers
504 views

Javascript - Find a deepest node in a binary tree

Problem Statement Given the root of a binary tree, return a deepest node. For example, in the following tree, return d. a / \ b c / d My ...
0
votes
0answers
41 views

Treehouse's “out_of_this_word” (modified)

A code where the goal is to get as many words as possible from one string. The rules are strict but users can cheat easily because this is not an English dictionary. ...
2
votes
1answer
59 views

Bubble Sort: Time and Space Complexities

Algorithm Bubble sort, also known as sinking sort, is a sorting algorithm that repeatedly steps through a list, compares adjacent pairs and swaps them if they are not in the right order. The pass ...
2
votes
2answers
69 views

Implementation of a Singularly LinkedList

I'm new to C++ and trying to learn by implementing data structures in it. Is the code below the most efficient way of implementing the data structure in C++? Does it conform to C++ standards, and how ...
3
votes
2answers
104 views

Tkinter program to teach Arabic

I am writing a lesson-based program to help teach friends and family the basics of Arabic. The program consists of different sections (letters, numbers, personnel pronouns, etc.) and each of those ...
11
votes
3answers
2k views

C# TCP server/client class

Goal My goal is to create a TCP server/client class that can be universally reused in various private projects. It should work stable and does not need to be super fast, but rather light-weight to ...
4
votes
3answers
181 views

Course Statistics Using Arrays and Files

I wanted to get some feedback here on my solution, because the course I am using is not allowing me to submit any answers. Objectives: Write a Java program that: Create a grades.txt ...
4
votes
1answer
85 views

Create HTML structure dynamically

We had a long HTML string with information about the makers of our software. However, for i18n this was unwieldy. So I started to refactor, so only each person's description is translateable, not all ...
4
votes
2answers
86 views

Project Euler # 74 Digit factorial chains in Python

The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145: 1! + 4! + 5! = 1 + 24 + 120 = 145 Perhaps less ...
2
votes
1answer
49 views

Simple landing page with a countdown timer and automatic slideshow with HTML,CSS,JS

Does this code follow common best practices? I tried to keep the code simple and straight forward adding comments and spacing everything to be readable. My main concern is there a common practice ...
3
votes
1answer
61 views

Project Euler - Problem No.5 - Smallest multiple

Here's the problem at hand: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly ...
4
votes
1answer
47 views

Find the total number of emails in a folder (with all of the subfolders)

The Folder struct definition below is given: type Folder struct { ID int emailCount int childFolderIDs []int } Description of the fields are: ...
2
votes
0answers
65 views

OpenGL C++ snake game clone

I've been learning OpenGL and C++ recently and thought I'd attempt to make a snake game. It would be amazing if you could take your time to read my code and give advice please. Please prepare yourself ...
4
votes
1answer
226 views

The Enigma Machine (CLI) in Java

A few days ago I began to work on my first project that's bigger than any others that I've attempted before. The purpose of this was to learn how to better code using OOP techniques. The code is all ...
5
votes
1answer
69 views

Rust code of a tree fractal

I just picked up Rust recently and this is my first program (longer than 10 lines at least) so I'm looking for constructs that are more native and natural to Rust. I come from a c++/ python background....
1
vote
0answers
41 views

Determine the hyper-parameters of an Approximate Bayesian computation

I created my own Approximate Bayesian computation algorithm in Python 3 and I try to find the best hyper-parameters for it but it is really slow. This question is not about the math involved in it. ...
3
votes
1answer
61 views

Project Euler - Problem No.4 - Largest palindrome product

according to the problem: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made ...
3
votes
2answers
50 views

Trial Division Prime Generator

...
4
votes
1answer
121 views

C++ beginner wrote Conway's game of life using SFML

I'm an intermediate Java programmer trying to learn the basics of C++. Thus, I decided to write "Conway's game of life" as my second C++ program (I already wrote a Mandelbrot image generator). It was ...
3
votes
2answers
85 views

Project Euler # 67 Maximum path sum II (Bottom up) in Python

This is Project Euler #67: Maximum path sum II: By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 ...
1
vote
1answer
47 views

Reverse a Linked List in place

I am solving some programming challenges for learning Javascript. The challenge I chose is: Given the head of a singly linked list, reverse it in-place. Here is my implementation in JS ...
2
votes
1answer
34 views

A program that expands a list of maps and chooses a random element

This is the essence of chapter 3 of "Clojure for the Brave and True". This program is about completing the list asym-hobbit-body-parts by adding a given number of ...
6
votes
2answers
227 views

Object Oriented Ascii dungeon game

I have solved an assignment (Exercise 33) from the MOOC Object-Oriented programming with Java, part II, but I'm not enrolled in said course. Assignment Summary In this exercise, you ...
2
votes
1answer
52 views

Project Euler # 55 Lychrel numbers in Python

If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. Not all numbers produce palindromes so quickly. For example, 349 + 943 = 1292, 1292 + 2921 = 4213 4213 + 3124 = 7337 That is, ...
3
votes
2answers
91 views

Project Euler # 54 Poker hands in Python

In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way: High Card: Highest value card. One Pair: Two cards of the same value. Two Pairs: ...
2
votes
1answer
72 views

Add method to Ruby's Enumerable module that produces every nth element

The task is to enhance the Enumerable module with a method nth(). The method shall create a new list, which contains every nth-...
7
votes
1answer
138 views

CtCI 16.8: Integer to English phrase in C++

I'm a C++ beginner working through Cracking the Coding Interview. This is question 16.8: Given any integer, print an English phrase that describes the integer (e.g., "One Thou­sand, Two Hundred ...
4
votes
1answer
64 views

Implementing linked list from scratch - Follow up

A follow up for this question: Implementing Linked lists in Python from scratch Node: ...
16
votes
3answers
4k views

Writing a clean implementation of rock–paper–scissors game in C++

I have coded a rock–paper–scissors game in C++, and it works exactly how I want it to. However, I was wondering if there is a way to simplify the code and clean it up. It is for a school project, so ...
3
votes
3answers
74 views

Join and map command line arguments in Rust

Is there a more natural way to do this in rust? I'm having a lot of difficulty trying to make this look clean. Type mismatches and borrowing have me stumped. What are some refactors that I could make? ...