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
2
votes
1answer
341 views

Find the Percentage from HackerRank

I am learning python by solving python module from HackerRank. This problem is Find the Percentage. You have a record of N students. Each record contains the student's name, and their percent ...
7
votes
1answer
155 views

C# random math questions project

I made a C# console math project where the user answers addition, subtraction, multiplication, division, power or square-root questions based on the difficulty they choose! However, I am struggling ...
0
votes
2answers
86 views

Comma separated string for list [closed]

I do not have an intention to ask for an answer, but I want to know if my answer is good for a two-week Python beginner? Question: (Automate the Boring Stuff with Python/ page 102) Comma Code Say ...
2
votes
0answers
60 views

Yet another Fahrenheit and Celsius converter

Introduction I am recently learning Rust by reading The Rust Programming Language (a.k.a. the book). I have finished the first three chapters so far, and this is my attempt for the first exercise ...
2
votes
1answer
55 views

Nested Lists from HackerRank

I am a beginner in python. This is the Nested Lists problem from HaackerRank. Given the names and grades for each student in a Physics class of N students, store them in a nested list and print ...
5
votes
4answers
152 views

Check whether a permutation with one fixed point can be rotated into one with two fixed points

A friend gave me the following riddle: Given n people with n distinct names, you place n names tags on a round table with n seats. If the n people now sit at those seats randomly such that exactly ...
0
votes
1answer
50 views

My first code - looking for feedback on best practices and things I should avoid doing in the future

After just learning a bit of Python I tried coding something myself. I attempted to do a game of Blackjack, which is far from perfect, and still doesn't have some rules a real game has (in my game an ...
7
votes
3answers
329 views

I made a guess the number game in Python

I just started programming a week ago. Online tutorials aren't my thing, so I decided to just start projects and learn what I need for the project. My first project is a guess the number game. The ...
1
vote
2answers
85 views

Monte-Carlo method to check triangle inequality

This is code for finding if inequality \$abc > 2(\text{area of triangle})\$ where \$a\$, \$b\$ and \$c\$ are the sides of any triangle. The below, and repl, code work as intended. However they ...
4
votes
1answer
298 views

A simple Decryption Program using Python

This is a program that can decrypt the codes that have been encrypted using the algorithm that my previously posted encryption program follows, you just need to enter the encrypted text from that ...
1
vote
1answer
59 views

Linear Equation in Two Variables Solver using Python

I made this simple program that can solve every set of linear equations in two variables. You just need to enter two linear equations of the form ax+by=c (without any unnecessary spaces) where 'a' is ...
2
votes
2answers
159 views

Get pixel color from screen in C++ on Linux

For a long period of time I worked on this code, mostly trying to understand it. That is the main reason for needed review. Second reason is simply that I would like to optimize it in any way you can ...
12
votes
3answers
2k views

A simple encryption program using Python

I made this encryption program in Python. I don't have much experience (or any experience at all) about encryption (since I just gave my 9th grade finals), but I had this idea about an algorithm some ...
4
votes
3answers
159 views

A dice roller in C

I am learning C and, for learning purposes, I implemented a dice roller. It uses arc4random(3) for random number generation, as I couldn't find something better. It works both interactively, if no ...
3
votes
2answers
105 views

Code for saving / loading a class object

As I was advised, I broke my code into 2 classes. Could you take a look at the repository class and report what problems this code has ...
2
votes
2answers
291 views

Constructing a lexicon and frequency array from a long string

I have a dataset X_train, which is an array where each entry is an email (a string of characters). There are 11,314 emails, each of which is about 500 characters ...
2
votes
1answer
41 views

Better filereading and print formating in R

I am a beginner using R and I am trying to solve some simple statistics problems and print the output. The following code takes in two datasets, computes the mean, ...
22
votes
6answers
4k views

Implementing any_of in C++

I've decided to implement Python's any in C++. I've gone about this using templates to allow multiple types of data to be passed, instead of overloading the ...
4
votes
2answers
107 views

login into school system

I am a beginner with C++, I am not learning OOP yet, I will start when I finish this project. I'm working on "Educational Management System Project". So I had trouble to code the part of login and ...
6
votes
2answers
395 views

Implementing web scraping in a function and in a class

The goal of my code is to implement a web scraping routine to obtain the name and the price of a product. I want to put this routine separated from the main program file. Sample url to scrape: https://...
1
vote
0answers
69 views

Brute force md5 checksum matching regex

The code starts with 128 bits of 0 (size of md5sum checksum) then brute forces to find checksum matching regex (all characters of checksum in hex are digits). I ...
12
votes
3answers
1k views

Implementing a rectangle class

First I've to indicate that this is my homework. An example of a given input is: s1 = {'p1': (x1, y1), 'p2': (x2, y2)} where all names and coordinations are ...
2
votes
1answer
84 views

React form actions > Edit, Save, Remove, Cancel

For my robot hobby project I need to expose the system's configuration so I can quickly make changes to it. So I have made a very simple app that generates a form. In this form you can edit, save ...
3
votes
0answers
49 views

Simple beginner Rust CLI file reader that prints to stdout

Q: Am I approaching writing idiomatic Rust code correctly? Hi CodeReview, I'm a beginner Rustacean coming from Python going through Rust books (The Rust Book, Rust in Action). A lot of the beginner ...
3
votes
2answers
94 views

C# maths quiz with user choosen difficulty-level

I have built a maths project that asks the user an addition, subtraction, multiplication, division, power and square root questions based on the difficulty level they choose! But I am trying to ...
0
votes
0answers
54 views

Code for creating a dialog for choosing a date

I have code that creates an AlertDialog to select a date by a user. I ran into a problem that this code began to take up a lot of space. Could you offer ideas on how to shorten this code / put it into ...
7
votes
5answers
914 views

C++ how to use std::any_cast and avoid else if statements

I have created a Node class that I am using for various projects in my data structures class(at school) and I am overloading the insertion operator <<. I am ...
15
votes
4answers
712 views

Determining if all values in a 2d array conform to specific criteria

I'm writing the following program for a school assignment. The prompt is as follows: A magic square is square grid filled with distinct positive integers such that each cell contains a different ...
2
votes
2answers
84 views

TicTacToe with Python

...
0
votes
1answer
33 views

Python graphical user interface test

In my programming class I am learning how to make graphical user interfaces, and so I decided to make one. ...
5
votes
1answer
75 views

Solving a linear system with two variables

Background: Equation 1: 2x-y=6 Equation 2: 4x+3y=22 Because 1 is ax-by=c and 2 is dx-ey=f y=(a * f - c * d) / (a * e - b * d) and x is simply (c - (b * y)) / a) What I am trying to do: ...
2
votes
1answer
71 views

Longest Alternating Substring Code Challenge

I'm still new to C++ and tried one of the harder challenges on a coding practice/challenge website. The challenge was the following: Given a string of digits, return the longest substring with ...
7
votes
1answer
164 views

Pyqt Tic Tac Toe

Recently discovered PyQt5 and decided to make this as a 'hello world' for GUIs Would like input on the design, best practices, as well as idiomatic nature of the application and its structure. Game....
7
votes
3answers
1k views

Count the number of duplicated chars in a string

It's an exercise, which I found on Codewars. Instructions: Write a function which returns the count of distinct case-insensitive alphabetic characters and numeric digits which occur more then once ...
17
votes
1answer
2k views

Rock Paper Scissors Lizard Spock

I got some good feedback from the last code I posted which I have incorporated in to this project (enum, try, f string formatting), so again just looking for some feedback on how the code could be ...
6
votes
1answer
269 views

List-based stack implementation in C++

I'm new to c++ and that is my list-based stack implementation. It works, but i'm not sure that my code is good. Please help me to improve this code, any advices are welcome. ...
1
vote
1answer
52 views

Speeding up naive backtracking Sudoku Solver in Haskell

After watching a recent computerphile video on building a very simple sudoku solver I tried to implement the same in Haskell. From this CR question I learned that it is probably a better idea to use ...
15
votes
3answers
3k views

2D Collision Detection in C++

I'm attempting to rewrite the classic snake game in c++. What I am inquiring about is my implementation for a 2D collision detection function. I am utilizing ...
3
votes
1answer
70 views

Exercise: Reading doubles from a file and printing mean, max and min (from Programming Principles and Practice using C++)

Read a sequence of double values into a vector. Think of each value as the distance between two cities along a given route. Compute and print the total distance (the sum of all distances). Find and ...
3
votes
0answers
45 views

HSL Guessing Game in Svelte

The objective of the game is to guess the hue, saturation, and lightness values of a given color swatch across ten rounds. https://github.com/shreyasminocha/guess-the-hsl https://guess-the-hsl.now.sh ...
9
votes
1answer
141 views

A Python based Tic-Tac-Toe game

As a basic project, I've programmed the game of noughts and crosses (tic-tac-toe) using classes. I made three classes: Board, ...
4
votes
1answer
954 views

Implementing a queue in C++

I'm trying to implement a really basic queue (as an array) in my computer science class and want some feedback on my logic/methodology. the queue is not circular, it just includes the basic functions ...
2
votes
1answer
47 views

Array to key/value JSON conversion

I'm very new to Javascript... Below is my code to convert Array to key/value JSON. Would like to know if there is a better way to achieve this or if I use any know bad practices. An input: ...
3
votes
2answers
58 views

Get best trip info from tripgo API and save to CSV

This is for an API and I want to optimize this because it has 2 for loops followed by another 2 for loops and it is taking 4 hours for 40000 rows in the database. The object obtained after the ...
1
vote
1answer
64 views

Three-way join in Entity Framework Core to retrieve all roles that a user has

I'm very new to Entity Framework Core, so I'm concerned about whether I've done this query in the most efficient way possible. The database I'm querying looks like this: Basically, ...
8
votes
2answers
866 views

O.O. Teacher List

After the feedback I got on my previous question, I decided to try one more program to see if I understand O.O.P. The idea for this is also based off the project I am working on im my class for this ...
4
votes
1answer
111 views

Snowflakes in C++

I've started learning C++ using Microsoft Visual Studio. I'm decided to create a simple GUI program that creates a "snowflake" wherever the user clicks on the screen. Seeing as how this is my first C++...
1
vote
1answer
58 views
11
votes
3answers
991 views

Interactive Discord bot for tabletop RPG

I'm new to Python, but have experience in a variety of other languages. I've learnt that a code review early on would make sure I don't start with bad habits. Which are more difficult to get out the ...
5
votes
1answer
86 views

Averaging students' scores

I'm still a beginner, so I'm still learning. I'm trying to take test scores for 3 different students, enter them in an array, then display the name, test scores and the average. Trying to also have ...

1
3 4
5
6 7
129