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
1
vote
2answers
14 views

Student Registry Program

Or in other words, a student database program. What does the code do? Checks if there is a text file - if not, creates one with table such as: student's name student's surname student's id and so on....
4
votes
3answers
161 views

Converting lengths and weights using functions in C++

Question is: Write a program that asks the user if he or she wants to convert lengths or weights. If the user chooses lengths, then the program asks the user if he or she wants to convert from feet ...
1
vote
1answer
31 views

CS50 mario printing pyramids without using "CS50 library"

I am new to programming and I've only learnt basics of C as far as functions. I decided to solve this problem given in Harvard CS50 course. Please review my code. We had to write a program which takes ...
0
votes
0answers
24 views

Script to fix linkage done with #pragma comment(lib, "a.lib) for Visual Studio project

I have a legacy project that has a lot of linkage done using #pragma comment(lib, "libname.lib"). Moreover, some projects define linker directives in ...
3
votes
1answer
34 views

Variable Grid Size Tic Tac Toe

Tic-Tac-Toe from scratch. Code Ugliness check before I implement the win-condition and maybe get set in to bad habits. Questions: As implemented: Better to pass board between functions or set as a ...
1
vote
3answers
79 views

Export DGV data as a table to a word file using Xceed's DocX library

my winform app contains a combo box, a button and two datagridview among other controls. Both DGV's have 3 columns. When I select an item/items from one or both of the DGV's and hit the button the app ...
1
vote
0answers
28 views

AdventofCode 2021: Day 3 Solution

I am beginner to Haskell. Here is my solution to Advent of Code 2021 Day 3. Let me know what you think. I was looking at the transpose function and decided not to use head & tail function. Given ...
0
votes
1answer
42 views

Go logging wrapper that adds log levels

The package is essentially a small wrapper around the stdlib logger that provides a very simple, easy to use logger that can toggle between different log levels (DEBUG, INFO, WARNING, ERROR). Log ...
14
votes
4answers
3k views

Split a restaurant bill, including tip

Just looking for a little feedback on the below tip calculator I've coded rounding the output to nearest 2 decimal places. Just wondered if it was readable and code friendly? ...
1
vote
1answer
39 views

Conditionally drop rows in grouped data.frame using dplyr in R

I have a data frame with columns for three predictors that try to predict the target variable 'change' with values 'yes' and 'no'. The data frame is grouped by id, and for every id, I have 4 years. ...
5
votes
0answers
63 views

Rust CLI for playing Wordle

I wrote the following CLI for playing the popular word game - Wordle. Wordle is a word game in which players are trying to guess a 5 letter word. Each turn they guess one 5 letter word, and for each ...
2
votes
0answers
37 views

Parallelized Web Crawler

Exercise is here: https://go.dev/tour/concurrency/10 Prompt: In this exercise you'll use Go's concurrency features to parallelize a web crawler. Modify the Crawl function to fetch URLs in parallel ...
8
votes
3answers
348 views

Implementing a efficient Infix to Postfix using Shunting-yard algorithm

I was trying to implement an efficient (in terms of size of code (such as using one liners) and time and memory-efficient) of Infix to Postfix in python without the use of any external modules i.e ...
3
votes
3answers
102 views

Bird watching database in Java

I'm learning Java in a MOOC right now and this is my solution for exercise Big year. This is the exercise: In this exercise you will design and implement a database for bird-watchers. The database ...
6
votes
4answers
614 views

Simple Singly-Linked List class

Decided to write something simple and came up with idea to write simple single linked list in C++ to improve my knowledge about pointers and memory management in C++, and wrote this: ...
1
vote
2answers
110 views

Function wrapper that prints the result

(English) I was recently challenged to make a simple program that does the following: Function f accepts as a parameter a function g, which returns a value. Function f must return a function h which ...
-1
votes
0answers
26 views

Saving Functions into Package in Jupyter Notebooks

not sure if I'm phrasing my question correctly but here goes. I've been using Python in a Juptyer Notebook on juptyer hub for one of my class. I've written many useful functions that I want to use to ...
3
votes
4answers
323 views

Find differences between two directories

Coming from another language than Python, I would like to see if my code is "pythonic" enough and follows good practices. It compares two directories, showing all files that are in one and ...
2
votes
1answer
72 views

Can you criticise my Snake Game in C?

This is my first year at university, and I'm trying to learn everything about fundamentals. I've coded a snake game recently in C. This is a programming-challenge that I've given to myself to practice ...
2
votes
2answers
98 views

Remove else-if statement from multi-conditional logic

INTRODUCTION I am studying the book Five Lines of Code (2021) by Christian Clause. The book covers several techniques regarding refactoring legacy code. I am learning much and applying several of its ...
11
votes
4answers
3k views

Zipping two lists with an offset in Python

Walking my first steps in Python from C, I find myself missing pointers from time to time. In this case I want to go through a list processing two element at a time, where those elements are step ...
4
votes
2answers
116 views

All In One Stock, Program for My business

I built my first program to solve an issue occurring at my self-owned business.. This program I made after learning a bit of C. It took about a month to make and what it performs is various functions ...
2
votes
0answers
59 views

OOP Blackjack in Python 3.9.9

I've noticed I'm not the first to post this topic. As a matter of fact, I have taken some inspiration from Victor Nguyen Bao's post to help structure my code. Here's the link to his code: Structured ...
4
votes
2answers
375 views

C++ simple 2D vector

I'm brand new to cpp and tried implementing a simple Vector class that supports abs(), equality and addition operators. I just wanted a quick set of eyes to tell me if I'm doing anything egregious in ...
2
votes
2answers
39 views

commandline Password-Generator in Kotlin

So I (a newbie to programming) wrote this password-generator as one of my very first programs in Kotlin. I started with Java a few weeks ago. I soon realized that Java was too hard for me, so I ...
1
vote
1answer
38 views

Conway's Game of Life in C++ with a Board Struct

I made the game of Life in C++ for a highschool class project. The website we're using doesn't have an autograder for C++, and my programming teacher doesn't really know how to program... so I'd love ...
1
vote
0answers
38 views

Lock-Free Single Reader/Single Writer Lamport Queue

I've created a lock-free lamport queue in rust. My code should be clear enough that you won't need to understand a lamport queue before reading it, but if you'd like a reference, this paper give a ...
4
votes
2answers
126 views

C++ calculator supporting five operators

Recently I started learning c++ and I had an idea to make a calculator, that can take any imaginable number and I wrote this code: ...
1
vote
1answer
50 views

How do I get the unique list of values from a hashmap in rust?

I have the following code which finds all the unique values from a hashmap of String to Vec. I cobbled it together (eventually as I was getting various borrow errors along the way), but it looks a ...
3
votes
2answers
417 views

Print square numbers from 1 to 9999 (non-tradfn)

I'm making a simple program that outputs the squares. I have a question: Is there a way to improve the speed but make the Code readable? Code ...
1
vote
0answers
41 views

Java reimplementation of the Python difflib.SequenceMatcher class

I'm rewriting a Python script into an Android app. This script uses difflib.SequenceMatcher to compare sequence of strings. I haven't been able to find something ...
2
votes
3answers
52 views

Javascript date / time display

I'm writing a simple start page and it's my first time with JavaScript, my previous background is Python/VBScript. Is it good enough? What best practices should I apply? Should I compress and nest the ...
2
votes
0answers
42 views

Flask API application to serve SPA webapp

I've recently started learning python to gain some fullstack skills and am working on a backend for a webapp as a learning project. Before I get too far down this path I was wondering if someone ...
4
votes
2answers
60 views

Linked list implementation for a beginner in C

So I've decided to dabble a bit into C, and while it's trippy as heck I've finished an implementation of a linked list for practice. I've pretty sure there's some type of obscure bug or memory leak in ...
2
votes
1answer
62 views

Finding cycles in graph

I found this code for Java to find if graph has cycles and I edited it to print out path of cycle. I use adjacency list. As it is directed weighted graph I will need to implement compensations of ...
0
votes
3answers
79 views

Object-Oriented Hangman In Python [Follow-Up]

This is a follow up after revisions made from this question. I've separated the program into 2 classes. The HangManData class is used to store game data such as the ...
-2
votes
0answers
18 views

Why does sys.exit() subtract the total? [migrated]

I have a task at hand to write a program to calculate the sum of numbers. This is a beginner python program. I have found two solutions for this exercise in which one is working perfectly well and ...
4
votes
1answer
75 views

Objected-Oriented Hangman game In Python

I'm still a beginner in python and made this simple program to practice OOP, I've ended up using the self keyword a lot and I'm not sure if this is normal or if I ...
0
votes
0answers
20 views

A bit of inventory management code I made using ScriptableObjects in Unity that lets you find items, check if you have items, and take items

It took me a while to figure this out, it's probably the most flexible code I've made. There might be some small mistake somewhere as I didn't get to fully test it, I'm just looking for glaring issues ...
4
votes
1answer
40 views

Four HTML tabs elements, with fade animations, activated by buttons

I am pretty new to Javascript and trying to make a really simple tabs element which is just hiding and showing sections depending on which button is clicked. I know that this is a terrible way of ...
4
votes
2answers
357 views

Budget Analysis Program

I have written code for a budget calculate program. Here is the problem : Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompts ...
1
vote
0answers
62 views

LazyList[T] in Python to provide a drop in replacement for a list that only generates what it needs on the fly

I made a LazyList class that can wrap an iterable (list, generator etc.) and turn it into a MutableSequence (like ...
0
votes
0answers
13 views

Shell script to invalidate AWS cache

I made this script to invalidate AWS cache. The purpose of this script is to retry the command multiple times because we make a lot of invalidations and we often reach the number of concurrent ...
10
votes
6answers
2k views

Console Library System in C++

I'm a beginner and came up with this simple project in C++. Any feedback would be very much appreciated. GitHub Repo Note: I'm using a file called "db.txt" as a database. main.cpp ...
5
votes
1answer
59 views

Text adventure combat prototype

I am pretty new to Python and programming in general, since I go to a programming school I am learning a lot of things by the book, which personally it doesn't suit me and I am falling behind everyone....
1
vote
0answers
78 views

maximum total reward of a game

The code is an attempted divide and conquer method of finding the maximum total reward of a game where each turn two adjacent numbers in an arbitrary list are multiplied by each other to create a ...
5
votes
7answers
2k views

Determine if a word is a palindrome

I'm a newbie programmer and was given a task to find if the input word is a palindrome or not. Now, I've written the program to the best of my ability but would like to know how it could be improved. ...
6
votes
1answer
213 views

Hot Dog Cookout Calculator

Hiii... Can you please check the code and see whether I might have done a mistake ? Beginner's eyes can be misleading quite easily. I feel like there's something wrong in this solution. I can't ...
3
votes
1answer
66 views

Idiomatic way to extract matches from rust Regex?

I'm learning rust and doing an exercise where to parse a particular SGML document. Each line in a document can be either an opening tag "" , a closing tag "" or a scalar: " ...
3
votes
1answer
83 views

Generate and display usernames

Everything currently works exactly as requested by the instructor, I've included as much possible commented documentation as I can think of to make it easier for people to see what the required ...

1
2 3 4 5
143