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
5
votes
1answer
46 views

Windows function to use NamedTemporaryFile

For my package dealing with pptx-files I need to create a temporary *.pptx file, to open in PowerPoint (e.g. to export as PDF). After some research I found that tempfile.NamedTemporaryFile is broken ...
2
votes
1answer
123 views

C++ Bunny beginner exercise

Write a program that creates a linked list of bunny objects. Each bunny object must have Sex: Male, Female (random at creation 50/50) color: white, brown, black, spotted age : 0-10 (years old) ...
4
votes
3answers
488 views

Terminal-based Blackjack

Normally I code in Java but have recently been trying to teach myself C for a university course I will be taking next semester. (I'm about to enter my third year). I wouldn't consider myself the best ...
4
votes
2answers
178 views

Messy Hangman Game

As it is now the end of my semester for my programming class, we had a final test were we were supposed to make a short hangman game. I have since added some small improvements, such as showing the ...
5
votes
3answers
131 views

Calculate compounded interest

My job for now is to teach a trainee how to program. I told him to solve the following task, given by a book (I try to translate it): Write a program for compound interest calculation. The user has ...
5
votes
1answer
102 views

Beginner 'Peg Solitaire'' game

This time I wanted to make a board game that is very popular in Brazil, it's called 'resta um', it means 'there's only one left'. The idea of the game is that there are holes in which there are pieces ...
4
votes
3answers
83 views

Seconds into readable time information

I had an exercise to solve, written in German. I try to translate it: Write a program that takes an amount of seconds. The program than has to output the number of years, days, hours and seconds. ...
5
votes
0answers
65 views

N-body brute force python bodies disappearing to infinity [closed]

(I hope this isn't too general a question given I'm just pasting a bunch of code in, if that's the case then sorry) edited to remove the bit that wasn't working I've written a brute force ...
4
votes
1answer
64 views

Outputting flavor text depending on inputted strings

I have this program that takes two strings from the user, stores them in mixArray, then "mixes" them with mixItUp() and outputs ...
1
vote
2answers
56 views

Reversing input characters

The given code reverses an array of input characters. The additional while loop in reverse() function is unnecessary I guess. ...
4
votes
2answers
150 views

Beginner Quiz game (True or False)

This time I made a quiz game, in which the player is asked questions and receives points for each question answered correctly. Some people told me I should learn about classes, so this is what I came ...
8
votes
2answers
130 views

Printing a 2-D array diagonally

The case scenario: A 2-D array is given: 1 3 6 10 15 2 5 9 14 19 4 8 13 18 22 7 12 17 21 24 11 16 20 23 25 and its size ...
5
votes
2answers
157 views

Single round handicap calculator for golfers

For a basic program I am writing to help learn, I am at the step where I should be cleaning up the messy code and trying to condense my "main" to 5-20 lines by recalling other methods that repeat ...
2
votes
2answers
71 views

Login and account system

So here I wanted to make a system that registered a person's account. It remembers the person's email, account, first and last names, by writing to a file. You can login to that account by typing the ...
1
vote
0answers
40 views

Implementation of Promise.race [closed]

I took a stab at implementing Promise.race(): ...
4
votes
1answer
172 views

Beginner python tic tac toe with AI

I've come up with this code for a tic tac toe game with and AI that the player can go against, please help me optimise my code and help me grow better habits haha. ...
12
votes
3answers
2k views

Basic Sudoku Solver

For my programming class I had to make a sudoku solver. ...
3
votes
1answer
86 views

Implementing `Promise.all()`

I took a stab at implementing Promise.all(): ...
5
votes
4answers
702 views

Nested If, working like an excel SUMIF for two unequal lists summing the distance if GPS timestamp meets criteria

This is my first post, I am very new to coding and Python especially, This code intends to do an excel SUMIF between two tables with different indexes. The first tables has GPS data with timestamp, ...
1
vote
0answers
41 views

Game Level Unlocking Logic Java [closed]

I am making a quiz game and every time you complete a stage, the next stage will be unlocked. The Problem: When I am at Stage 3 and finish it, Stage 4 is unlocked. But when I feel like I want to ...
0
votes
1answer
38 views

Spaceship Operation in for Lexicographic Comparison

I have written a program in Java 8 using BlueJ. There is just one function of type byte that accepts two String values and return 1 if the first word comes before the second in alphabetical order, and ...
3
votes
3answers
326 views

Sudoku Solver questions on style and algorithm

I am working towards a CSC degree right now and wanted to try and practice writing good code that could be easily maintained and read in industry. I wrote the following program in Java that takes a ...
2
votes
0answers
173 views

Snake Game for Raspberry Pi Sense HAT written in Python

Goals learn Python improve problem-solving skills improve my coding style Hardware This code runs on a Raspberry Pi 3 Model B (Raspbian OS) in combination with the Sense HAT. The 8x8 LED-Matrix on ...
6
votes
1answer
172 views

Blackjack / 21 in Python3

I have created a blackjack game in Python3 but I am worried that it is not very efficient and also there are some problems with it. Problem 1) The player almost always wins unless he goes bust as the ...
3
votes
3answers
82 views

ID generator class for my Repair Shop Software

I have made a ID generator class for my Repair Shop Software, that generates new ID for all data entities that are used in the software. It also converts int value ...
13
votes
2answers
790 views

Beginner Coin Flip project

I think I finally finished a small coin flip project I found online. However, I'm pretty confident this is far from the optimal solution and would really appreciate any feedback on how this could be ...
1
vote
1answer
62 views

Hangman game in beginning Java

Hangman game coded in Java (at a beginner's level) where Hangman.java can be run with one or more arguments. Hangman.java: ...
6
votes
3answers
212 views

Chess game in C

I've never programmed in C before, but decided I wanted to try making Chess. Currently there's no way to check whether the game has ended. Was looking for critique for future projects. ...
1
vote
2answers
140 views

A simple AI for Tic-Tac-Toe game

This is an AI class that takes an array of the board as an argument, and plays the best move after evaluating the board and gets a win rate. I haven't used any java package to do this. How can I make ...
3
votes
0answers
34 views

Accurate && precise location data within a timeframe (session)?

Scenario A session would start & end within a time frame. Within this time frame, the device would be moving within a constraint environment. The movement would be extremely slow (slow-walking ...
3
votes
2answers
238 views

Dynamic Array Implementation in C++

I've finished implementing a dynamic array in C++. I'm a beginner in C++ and also in algorithms and data structures, so any constructive feedback about improving the implementation would be greatly ...
1
vote
0answers
23 views

Display Correct Div based on Radio Button Checked

We are using a plugin for our WordPress website. I'm trying to add some custom code to it and finally got it working however it is ultra janky. The HTML is a simplified version of the actual site's ...
1
vote
1answer
73 views

Car Milage and Cost Calculating System based off menu selections (using a class)

I was wondering if anyone would be kind enough to review my basic c++ program. I'm a beginner programmer so was hoping to get feedback on how well I've used object oriented programming i.e. using a ...
8
votes
4answers
175 views

Saving worksheets as pdf and sending per mail

As the year comes to an end our company need new time-sheets for the new year. Because this is my task to do, I thought I would do my collegues something good by automating some tasks they would ...
4
votes
1answer
85 views

Inserting Elements Into a Sorted Array

Very new to JS (wrote my "Hello World" around 3 days ago), but not to programming in general. My documentation is inspired by the approach I followed for Python (since I haven't learned JS ...
2
votes
2answers
49 views

Flexible array member polyfill && Vector implementation in C89

I wanted a polyfill of flexible array members in C89. So I made something similar, and made a toy std::vector with limited functionality on top of it. Here is the code: vector.h ...
3
votes
1answer
181 views

Codewars: Sum Strings

Sum Strings Codewars kata. It's supposed to be able to handle big integers.   Question Given the string representations of two integers, return the string representation of the sum of ...
6
votes
3answers
177 views

Colourful block digits

I have not done Javascript programming in almost a decade. I see that it has changed a lot. Below is code that displays colourful block digits. Any constructive feedback is welcome. ...
2
votes
1answer
105 views

Codewars: Pick peaks

Pick peaks Wrote my "hello world" on Thursday, so definitely a beginner. I know some Python, so not a novice to programming in general. Question For example, the array ...
1
vote
1answer
74 views

Codewars: Reverse or Rotate

CodeWars 6 Kyu: Reverse or rotate? I wrote my Javascript "hello world" on Thursday, so I'm definitely a JS beginner. I do have some experience in Python though, so I'm not a complete novice to ...
1
vote
1answer
68 views

Java OOP Mental Math Program

I am currently working on an object-oriented mental math program using Java Swing. Since I am relatively new to the object oriented principals of design, it'd be nice to know how well the code ...
1
vote
2answers
68 views

Class for User-defined Binary data type

I have written a program for a user-defined binary data type in JAVA. It has static methods for purposeful usage methods for binary arithmetic methods for bitwise operations It's ...
3
votes
1answer
72 views

Enhance function that justifies text

On Codewars, there is a challenge where the goal is to justify an str into a certain len. Here are the rules: Use spaces ...
5
votes
1answer
80 views

navigation bar with forward fading links

I'm fairly new to HTML/CSS and I've put together a navigation bar. The purpose of the navigation bar is to be clean and mobile-friendly. I would appreciate some feedback on what I could do better ...
1
vote
1answer
55 views

Beginner's level hovering effect on anchors

After a few trials I've written this code where the border of a link expands: ...
4
votes
2answers
91 views

Human Jug and Glass

I am a beginner in Java. I have created this small project in Java with the inheritance concept. Here the Human will fill, pour and drink water. There are three classes: Glass, Jug and Human. Let me ...
4
votes
2answers
80 views

Sequence Generator from previous max sequence based on certain conditions

I'm new to VBA programming so the following code may look terrible which is why I want ways to understand how to better optimize it and other future codes. ...
2
votes
1answer
65 views

Priority queue with Max-Heap

I'm studying with book "Introduction to Algorithms" and implemented PriorityQueue without existed Class. I made a MaxHeap class with Array and made a PriorityQueue with my Heap class. Actually code ...
7
votes
1answer
78 views

Cis 194: Homework 3 (Histogram)

I am following CIS 194: Introduction to Haskell (Spring 2013) online to teach myself Haskell. Following is my response to third exercise of Homework 3, namely Histogram. In which ways I could improve ...
5
votes
1answer
192 views

IntCode computer in Python 3

I'm using advent of code 2019 to start learning Python. I've read the Python style guide, and I'm trying to write readable and reusable code. This piece of code is an implementation of the IntCode ...

1
3 4
5
6 7
127