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
9
votes
1answer
247 views

Simplified Linked List Implementation in C++

I'm learning C++, data structures and algorithms and I have implemented a (Doubly) Linked List class for practice. Some STL functionalities are deliberately missing for now (e.g. some functions ...
13
votes
2answers
2k views

A randomized encryption program

I have just created an encryption program with a friend. I wanted to know if anyone here could give me back any feedback on it. Here is how the program works: Imagine you want to encrypt the word '...
7
votes
2answers
168 views

Area/Surface Area calculator of shapes

I created an area of shapes calculator. It's my first python script and I just wanted to get a few tips, thanks in advance! ...
5
votes
3answers
238 views

Log monitoring with pythonic tail -f and process killing

The purpose of this cluster of functions is to tail the log file and kill/restart processes from shell (the latter is not yet implemented). ...
12
votes
5answers
2k views

A Simple Battleship Game

I have just finished learning basic-intermediate Python subjects and wanted to test myself. This Battleship game is the third game i have written. ...
3
votes
1answer
56 views

Count the number of leaders in both sides (slices) of an array in C#. Codility EquiLeaders task

EquiLeader A non-empty array A consisting of N integers is given. The leader of this array is the value that occurs in more than half of the elements of A. An equi leader is an ...
2
votes
1answer
72 views

A Simple Rock-Paper-Scissors Game

I have just finished learning basic-intermediate Python subjects and wanted to test myself. So here is the my basic Rock-Paper-Scissors game. ...
6
votes
1answer
86 views

A Simple Word Guessing Game

I have just finished learning basic-intermediate Python subjects and wanted to test myself. This word-guessing game is one of the first programs I have written. ...
4
votes
1answer
89 views

Extensible Fizzbuzz in Haskell

I am getting used to how things should be written/thought about in (idiomatic) Haskell. I wrote a FizzBuzz program that prints to the console. I wanted to generate things from the core info of the ...
4
votes
0answers
40 views

Importer for binary datafile of PI88 Nanoindenter

As an exercise, I want to rewrite a C++ program to import measurement files (and later create excelsheets, reports ...). The measurement files split in 2 files, a binary file, and a xml-file. Because ...
3
votes
2answers
72 views

A simple Pygame that has a square move and jump

How does this Pygame code look? Is the run loop usually in a class? I'm a beginner and was wondering what the best format and structure is for using OOP in Pygame. ...
4
votes
2answers
105 views

Tic-Tac-Toe in Python3

I am new to Python and would like to get helpful tips and suggestions on this code. Would be awesome if you provide info if anything is fundamentally incorrect, improve the algorithm, and any room for ...
2
votes
1answer
34 views

Find closest elements in an array relative to given index with a bias to distance from index and direction

This function determines which images should be loaded based on which image is currently in the viewport (array index), what direction the user is scrolling, and if the image has yet to be loaded. It ...
15
votes
4answers
2k views

First attempt: Python Rock Paper Scissors

I finished Python Principles and this is my first program I've done (mostly) from scratch since, having to get some outside help on the loop to repeat the program, and I saw a nifty thing about using ...
1
vote
1answer
77 views

Codility's stonewall 100% solution - different paths such as if,else if,etc, do the same thing

Here is the task description for the codility's stonewall problem. I would like to get a feedback on my code, and I specify at the bottom what the title states. (I had to make the figure by hand, ...
2
votes
2answers
79 views

Tic Tac Toe in C - Version 1

This was the first game I made not too long ago (2018), and while I'm working on another, more complex version, I want to know how good or bad I did this one and what can be improved. Note: the ...
3
votes
2answers
53 views

Identify possible pair of factors from a product

This is my first C++ program (not counting "hello world") and I'd like to know if there are some semantic mistakes or if I could rewrite the code in a more simple way. It performs brute-force ...
11
votes
2answers
2k views

A Caesar cipher in Python3

This code basically just does a Caesar cipher on the contents of the variable "s" with a shift of 1. Sorry if the comments on the code don't explain it well. I'm quite new to Python and I'm not very ...
2
votes
1answer
58 views

Dictionary function for R

I'm new to R and have created a dictionary function. A user will input a phrase into a text field and the server will read it and see if there's a match in a back-end data table and if so, output the ...
3
votes
1answer
58 views

Codility voracious fish are moving along a river, solution in C#

This is the task's description. My code gets 100% task score. Is it good code yet? (I think I'm getting a lot better, since I started solving this codility's exercises and posting here, but I always ...
1
vote
1answer
68 views

Keep reading Command-line until you get the word END

I have to write a code which takes (integers) numbers from Command-line and keeps reading the terminal until it gets a word END So I wrote the following; I feel ...
13
votes
4answers
3k views

Tic Tac Toe console program

I have been learning C++ for 3 months now. I decided to make something by myself, so I've made this little integer-based TIC TAC TOE console game. I need some advice on how to improve my code for ...
3
votes
2answers
107 views

Simple BubbleSort in GoLang

I'm just starting in Go. Please review the below code, and let me know what I can improve in this code. ...
3
votes
0answers
45 views

Implementing chat commands [closed]

I'm new to C++ and I'm writting some kind of chat server and client who talk to each other through commands for learning purposes. I serialize and deserialize these commands using a JSON library. My ...
2
votes
1answer
395 views

Salaries exercise

Hey there guys, I have just completed an exercise for uni and I would really like some feedback as I'm pretty new to using java. Areas that I could especially use some input in this instance: ...
2
votes
1answer
87 views

DataReader to To IEnumerable<object[]> To 2 Dimensional Array

Let me preface this with a few things before I get into my question: I am making the leap from VBA/VB6 to .NET, (boy is it a big one), so I am noob to .NET best ...
2
votes
2answers
185 views

Beginning BMI calculator in Java

This is my first program so no doubt I've made mistakes. The code works and meets all requirements as far as I can see. (Further info: program to calculate Body Mass Index (BMI) allowing user to ...
26
votes
9answers
4k views

Simple n-body class in C++

As part of my training, I implemented a n-body class in C++ to simulate gravitational interaction of bodies and to get more familiar with features that C++ offers such as object oriented programming. ...
5
votes
1answer
99 views

Rust code that reads two columns of data from .txt file

I'm writing a code to read data from text file in Rust. The target files have two columns and non-fixed length rows, for example, example.txt 1 1 2 4 3 9 4 16 ...
-1
votes
1answer
30 views

How to write a multivariate multi-step forecasting from a multivariate single step [closed]

I'm trying to implement a multi-variate, multiple-step model to forecast the day ahead electricity prices (h+1,h+2,...,h+24). I know how to do one forecast, but I'm confused with how to implement a ...
3
votes
1answer
42 views

File Utilities in Go

I'm beginning to learn Go. I've decided to write some file utilities to help me with some bigger projects I intend to write. Coming from mainly a Python background, I'm sure there are plenty of ...
6
votes
1answer
139 views

Simplified Vector Implementation in C++

I have implemented a class Vector to learn about data structures and algorithms and how to implement them using C++. I have yet to implement some std::vector functionalities e.g. custom allocator ...
3
votes
0answers
36 views

Molecular .pdb File Reader in Rust

I am new to rust and wanted to get going with a medium-sized project to help learn. I've settled on creating some basic quantum mechanics code which starts with this bare-bones file reader. It takes a ...
6
votes
2answers
78 views

Atbash Cipher in Rust - Exercism exercise

So I'm working on an implementation of the Atbash Cipher for Rust - it is an exercise on exercism.io. I come from a little C experience and found my code to be rather round about and kind of tortured. ...
6
votes
1answer
62 views

Menu with buttons using pygame

I wrote this to teach myself how to make a menu with buttons and I want to know if I've done well and if there's any way to make it shorter and/or more efficient. ...
2
votes
2answers
84 views

Permutation generator with OR operator

Problem: Given a vector of strings, I want to print out all possible permutations where the strings may contain an OR operator (the | character, as in regular ...
5
votes
2answers
85 views

Haskell Graphing Module (Gloss)

I've been slowly learning Haskell over the past few months. I made a small module to graph functions using Gloss, and I would like feedback on how idiomatic it is (looking for ways to simplify using ...
4
votes
1answer
84 views

Magic Square with Five Methods (Python)

Problem Write a program to return a boolean if an input grid is magic square. A magic square of order \$N\$ is an arrangement of \$N^2\$ distinct integers in a square such that the \$N\$ numbers in ...
2
votes
2answers
63 views

Caesar Cypher Implementation

I am learning C# and for an experiment I tried implementing the Caesar Cypher cryptography method which just offsets every character of the string n characters. How can I make this simple program ...
3
votes
1answer
51 views

Simple projects planner on PyQt5

My task was : Create a Python application to display the active status of your IT project. Everyone the project has its own unique number that is generated at the stage of receipt project into the ...
5
votes
2answers
287 views

Magic Square (Python)

Problem Write a method to return a boolean if an input grid is magic square. A magic square is a \$NxN\$ square grid (where N is the number of cells on each side) filled with distinct positive ...
1
vote
1answer
92 views

Capitalize the First Letter of Words in a String (JavaScript, Python)

Problem Write a function that accepts a string, capitalizes the first letter of each word in the string, and returns the capitalized string. Examples ...
1
vote
1answer
74 views

Anagram (Python, JavaScript)

Problem Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is a string that contains same characters ([A-Za-z0-9]) and the order of ...
3
votes
1answer
46 views

Converting an input of space delimited integers to a list

tablou = input("Enter values delimited by space: ") b = tablou.split() t = [] # initial list with int() contents for l in b: r = int(l) t.append(r) I ...
2
votes
1answer
58 views

LeetCode 65: Valid Number (C++)

Problem Validate if a given string can be interpreted as a decimal or scientific number. Examples: ...
3
votes
1answer
34 views

A class and a function to create and light up buttons in PyGame

This is my first ever try at making reusable code. The function makes use of two images to give the illusion of turning on and turning off a button in pygame. I would like to know what would you do ...
2
votes
1answer
50 views

Beginner tic-tac-toe implementation

I finally made tic tac toe as a beginner(took a month and a bit) and I want to know if I made things more complicated than they should. It seems like a lot of code for a simple game but I'm not sure. ...
4
votes
3answers
623 views

LeetCode 65: Valid Number (Python)

Problem Validate if a given string can be interpreted as a decimal or scientific number. Some examples: ...
4
votes
1answer
81 views

Russian Peasant Multiplication Algorithm

For university, we have just started to learn C++ as a language, and one of our challenges to do in our spare time is to write an algorithm for 'Peasant multiplication'. In the challenge, we have been ...
1
vote
2answers
83 views

MaxProductOfThree in C#

This is my solution for the MaxProductOfThree from codility, it scores 100%, but I'm not a fan of the if if if structure it has going on. Task description ...