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
0
votes
0answers
5 views

gpuIncreaseOne Function Implementation in CUDA

I am trying to perform the basic operations + with CUDA for GPU computation. The function vectorIncreaseOne is the instance for ...
8
votes
2answers
1k views

Tic-Tac-Toe code using c#

I am a beginner coder and was wondering how to improve my c# console code. It makes a tic-tac-toe game. ...
-1
votes
0answers
32 views

Server-side form validation [closed]

I am validating a submitted form. My HTML code: ...
0
votes
1answer
51 views

getint-like function

You probably know the following problem: You have written a small program that runs in your console and want the user to enter something. of course, it is very inconvenient when the user types the ...
-1
votes
0answers
27 views

finding multiples of 5 in phython [closed]

how do i write out a program whose procut will be the multiples of 5. I did this but it said it was wrong. for m in range(1, 101) ...
2
votes
3answers
63 views

Read and sort an array of integers

...
5
votes
1answer
63 views

singly linked list python code

I have recently tried converting a singly linked list from a C program into my own python program. I have tested the code myself but I am still unsure if the program has been converted properly. I ...
1
vote
1answer
55 views

Binary-Decimal-Hexadecimal converter

I'm a fairly new programmer and have been learning c++ for about 8 months now. I've written a program that can take either binary, hexadecimal, and decimal inputs and convert them to the other two ...
3
votes
1answer
75 views

Hangman Game from OCW MIT 6.0001 Pset No. 2

I just completed Pset 2 about the Hangman game that was issued from OCW MIT. The Pset has no available solution so that any comment regarding code writing best practices would be greatly appreciated (...
1
vote
1answer
24 views

Easter date calculator Android application

Since Easter holidays are close, I have decided to develop my Android skills by writing an Android app that calculate that date for the Western and Easter calendars. The formulas were gotten from the ...
4
votes
1answer
77 views

text-based RPG game in python- character selection

I am making an RPG game using python. At the moment, I have programmed choosing your character and saving it. However, today I previously asked a question ...
2
votes
1answer
53 views

C++17 Recursive Fibonacci calculation with memoization

Compiler is g++ 4.2. I'm new to C++, but I've done a lot of data science, web scraping, and some socketing stuff in Python. This code generates the nth Fibonacci number, either with a naive ...
6
votes
2answers
138 views

Basic Collatz program with input validation in Python

In chapter 3 of Automate the Boring Stuff with Python by Al Sweigart, one exercise asks to write a program which performs the Collatz sequence. I wrote a basic version first, then added and ...
1
vote
1answer
50 views

Company database REPL program in Rust for Chapter 8 of The Book

Using a hash map and vectors, create a text interface to allow a user to add employee names to a department in a company. For example, “Add Sally to Engineering” or “Add Amir to Sales.” Then let the ...
4
votes
2answers
81 views

Word search searcher

I made a word search searcher that searches whether a word search contains a given word. My code is super messy I know, way too many try blocks, nested loops etc. Maybe I've just used a bad approach. ...
3
votes
1answer
48 views

Random number generator [Beginner]

I'm learning Python and I'm building a basic random numbr generator. The code below works as expected. I'm just wondering if it uses best practice / can be made better. Some future considerations ...
6
votes
2answers
551 views

Simple Banking System with Python

Relevant Background: Greetings. This is my first attempt at using the OOP paradigm (only really used R prior to this). The project prompt came from ...
3
votes
1answer
46 views

Building a madlib generator

I'm learning Python and I'm building a basic madlib generator. The code below works as expected. I'm just wondering if it uses best practice / can be made better. ...
3
votes
1answer
80 views

Tic-tac-toe Game Optimization (C++)

I made a Tic-tac-toe game where you can play against the program or with another player in C++ and I know the code is far too long for what it is. I've tried to optimize it using non-void functions (...
2
votes
0answers
45 views

Reduction on the gpu

This program adds together all elements in an array with the function parallelReduce. Includes testing on an initialization with all 1's and a calculation of the ...
2
votes
0answers
126 views

Tic Tac Toe game using WPF+MVVM

I am looking for some advice on how to create a new ViewModel within an already existing ViewModel. I am creating a Tic Tac Toe game, to improve my knowledge of the MVVM pattern, WPF and C#. I am ...
1
vote
1answer
34 views

PowerShell script to convert .reg files to PowerShell commands

This is a PowerShell script I wrote a while ago that converts Windows Registry files to PowerShell commands(New-Item, Remove-Item...
0
votes
2answers
46 views

Identifying the closest player to an internal 2D grid

I've written a function that returns which player is closer to a given 2D grid within a larger 2D grid. I would like to make the function shorter (in LOC) and better. I would appreciate any advice on ...
4
votes
1answer
134 views

Railway Management System

Recently, our High School teacher gave us a pseudocode assignment for the preparation of CAIE's which was a Railway Management System. Everyone completed the task in pseudocode which for me was quite ...
5
votes
4answers
786 views

My code changes a single RGB value by a set amount, then does the same changes over the other channels

So I have the following code, that takes an image and modifies the RGB channels one at a time. It then creates a list of 9 images with the various modified channels. The Red channel is modified by 0.1,...
0
votes
1answer
66 views

filter and map functions

I am a JavaScript programmer beginning with Go. I tried to replicate filter and map functions like JavaScript's, as an exercise....
7
votes
2answers
150 views

Idiomatic use of `Option` and `unwrap` in mean, median and mode Rust program for Chapter 8 of The Book

I've recently finished Chapter 8 of The Book and have started doing the exercises at the end of the chapter. This post pertains to the first exercise which involves writing a program to output the ...
1
vote
1answer
51 views

calculate tree height (arbitrary tree) - python

Given an array as input, we have to calculate the tree height. For example, input [4, -1, 4, 1, 1] means that there are 5 nodes with numbers from 0 to 4, node 0 is a child of node 4, node 1 is the ...
3
votes
0answers
33 views

The nQueens problem in CUDA

I tried implementing the nQueens problem in CUDA, but it is actually slower than the sequential algorithm! What can I do to optimize this? This was run sequentially on an AMD Ryzen 5 4600H (clock ...
3
votes
2answers
723 views

Determine the longest segment of integers within an inclusive range that doesn't contain a bad number using Python

I am new to python. Got a question in Hackerrank. Given an Array of bad numbers and a range of integers, how can I determine the longest segment of integers within that inclusive range that doesn't ...
5
votes
1answer
138 views

Print a character frequencies as a vertical graph

I've been solving K&R 1-14. Exercise 1-14. Write a program to print a histogram of the frequencies of different characters in its input. After several edits, it looks good to me now. But it's my ...
12
votes
4answers
2k views

C++ dynamic array implementation

As a C++ beginner coming from Java, I have become increasingly confused on the topic of memory management and how to avoid memory leaks. Is the code below risking a memory leak that I'm not currently ...
7
votes
4answers
295 views

Linked list implementation, manipulation, and testing in C

This is a beginner's attempt at implementing a linked list in C. Please read the code and provide recommendations. I do not want to limit the reader's benevolence to only these questions, but my ...
3
votes
2answers
74 views

Stock analysis querrying data from yahoo

A while ago I created a program for fundamental analysis of stocks. Back then, I used to enter all the values by hand, which took a lot of time and was very annoying if a value was entered incorrectly....
3
votes
0answers
33 views

Creating a simple windows instance capable of rendering Direct3D graphics

I've just started to learn recently about Direct3D, when I've learned to create a simple window I started wondering if I could automate this process, so whenever I would need to create a window I ...
6
votes
2answers
95 views

Password reset system in PHP

What I try to achieve I need to create a secure forgot password reset system. I am especially worrying about the security of this code and how to further improve it. Here's my code: ...
4
votes
2answers
335 views

C++: eccentricity function on metric spaces

An eccentricity function with parameter \$r\$ on a metric space \$X\$ with \$N\$ points is \begin{gather} f(y) = \left( \sum_{x \in X} \frac {d^r(x, y)} N \right)^{1/r};~~~x,y \in X \end{gather} (...
5
votes
2answers
108 views

3D torus in Lua

I'm a total beginoob in Lua. The aim is to display a 3D Torus in dots (see Figure1), or at least compute the positions, privileging clarity over performance. Pseudocode link. Don't hesitate to be ...
9
votes
2answers
2k views

Automate the Boring Stuff Chapter 8 Sandwich Maker

I am currently learning Python by working my way through Automate the Boring Stuff with Python. This project is from Chapter 8 which is focused on validating input by using the PyInputPlus module. ...
1
vote
0answers
78 views

lengthening the time it takes to access files REVISION #2

https://github.com/speedrun-program/load-extender This is the previous post: C++ programs for Windows and Linux which let you lengthen the time it takes to access files REVISED VERSION To compile this,...
1
vote
0answers
27 views

PowerShell CLI calculator

I found a project that aims to implement a CLI calculator app in as many different languages and ways as possible. Having a little experience in PS, I tried my hand at it. The requirements are as ...
1
vote
1answer
62 views

C++ matrix class follow up

This is a matrix class with addition and multiplication. I tried incorporating all the helpful advice I got on my previous attempt C++ matrix class , specifically using std::vector for memory ...
1
vote
0answers
27 views

Read value from config and return function

I’ve the following function which should be run in production I read some config If valid add the runner otherwise just return, the function is working! Is there a cleaner/better way to do it in go? ...
1
vote
1answer
95 views

std::vector Allocator-Aware Implementation

I've just finally finished implementing std::vector. I'm currently re-implementing whatever I can in the hope to learn more of how data structures works. I tried to ...
7
votes
1answer
128 views

Blackjack game in Java

So this is a blackjack game, any feedback or tips on what I should remove from the code that is not needed is very appreciated. Note: some of the names of classes or variables are in Swedish but it ...
7
votes
2answers
97 views

Method to randomise a string's case

I'm an amateur at programming and have created the following method with which I pass a lowercase string with the idea it is then returned either in it's original ...
2
votes
2answers
85 views

Coin-flipping game

I'm 13 years old and turning 14 years soon! I Coded this simple text game in around 30 minutes, can someone rate it? and give some feedback ...
6
votes
2answers
79 views

Command-line Tic-Tac-Toc in Rust

I implemented Tic-Tac-Toe in Rust to learn the language. I split the implementation into two files: game.rs contains the actual game logic, and ...
2
votes
1answer
50 views

Temperature converter in Rust

I've just started learning myself Rust. I am practicing with the exercises from the book available on the official website. Here is my attempt at the temperature converter exercise at the end of ...
0
votes
1answer
26 views

Checking the type and validity of a credit card with Luhn's algorithm in C (CS50)

I'm taking CS50 Intro to CS. In this assignment, we're asked to make a program that can identify what type of credit card (AMEX, Visa, MasterCard) is given in the input (and whether it is valid.) ...

1
2 3 4 5
136