The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
6
votes
4answers
14k views

Random walk on a 2D grid

The program assignment: A drunkard in a grid of streets randomly picks one of four directions and stumbles to the next intersection, then again randomly picks one of four directions, and so on. ...
42
votes
1answer
3k views

Charmander Brainfuck interpreter in Haskell

I just started learning Haskell and this is my first big project (ie not factorials, fibonacci or graphers). This is kind of a gift for somebody so the language is a bit different. The program works, ...
17
votes
3answers
4k views

RPSLS Game in C#

I went with what I know and can use well, not what I know and can't figure the syntax out to make it look good. So please enjoy the code and prepare to school me (probably in the basics) in C# ...
12
votes
1answer
1k views

Responsive/adaptive website code

I have all these functions that work together to create functionality on a page. Is the structure of these functions OK? Can I do anything to speed this up or make my code better? I'm not exactly ...
16
votes
8answers
4k views

Project Euler Problem #4 - Palindromic number

The problem is as follows: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made ...
5
votes
2answers
117 views

A Simple Cluster Generator v0.2

[NOTE] This question can be depreciated in favor of version 0.3. This is a code revision of a previous post and works well. Code has been reworked to be far more clear and concise, thanks to ...
21
votes
2answers
1k views

Calculating Luhn-algorithm checksum digit

Today I decided to learn some basic Haskell, and for starters I made a program for calculating the checksum of a Swedish personal identification number. It uses the Luhn-algorithm, aka. ...
6
votes
3answers
2k views

Efficiency of Project Euler problem 35

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, ...
1
vote
1answer
129 views

contact.php file

This is my contact.php file which has only 2 functionalities: Response with the default page if it is requested by the get method Process the message posted by the ...
1
vote
2answers
271 views

My included in every script file

Right now I'm finishing my very first web application, and I will buy my first domain name in my life shortly. My project is about a personal website that I'm going to upload every application I ...
23
votes
9answers
3k views

Is this FizzBuzz Swift-y?

...
12
votes
4answers
3k views

Algorithm for Run Length Encoding - String Compression

I attempted a problem from the Cracking the Coding Interview book. The following input: aabcccaaa should give the following output: ...
25
votes
6answers
2k views

Are there any open vulnerabilities in this mailer script?

I made a PHP mailer script does the basic validation of fields, return errors, else submit if all is good. But it also has a honeypot field that is not required to be filled in (I'm assuming by hiding ...
13
votes
1answer
1k views

Cheapest hotel finder

Please help me make this code more object oriented. I also want to use a few more classes and separate the input processing code to another class. Question: A hotel chain operating in Goa wishes ...
1
vote
0answers
166 views

My included in every script file - follow-up -1

In this particular question, I need the reviewers help to judge my understanding to MVC and OOP as it was my biggest problem in my original question a month ago. I included in the question the contact ...
13
votes
7answers
2k views

Quadratic expression calculator

I'm hoping to get some feedback on how to improve and optimise a program I wrote which takes three values as input (via the terminal) and uses them in the quadratic formula. I'm aware this is mostly ...
7
votes
1answer
995 views

Log probe requests of WiFi devices

I developed a program that collects probe requests from WiFi devices. It already works but I think that a programmer can improve it. ...
7
votes
1answer
342 views

Calculating the number of rooms in a 2D house

I stumbled upon this problem on cses.fi (a problem set for the Finnish Olympiad in Informatics. This problem is in finnish so I'll translate it). I'll describe the problem, present the code and think ...
3
votes
1answer
122 views

A Simple Cluster Generator v0.3

[NOTE] This question can be depreciated in favor of version 0.31. This is a code revision of a previous post and works well. The purpose of this code is to produce a universe of points, randomly ...
1
vote
1answer
782 views

Opening a file and printing its contents line by line

Everything that I've read online says that the best way to open a file in python is: ...
36
votes
2answers
2k views

It'th wabbit theathon

I don't know regex. I want to learn regex, but learning regex just for the sake of regex would be quite boring. So I decided to learn Ruby as well (which so far looks a lot like Python, which I'm ...
8
votes
1answer
3k views

TicTacToe in Haskell

Are there any ways which I could improve and simplify this code? Is my code idiomatic Haskell? Is the use of a lens library to change an element of a two-dimensional array unnecessary? If so, how ...
2
votes
2answers
124 views

Digitizing paper label system with Python

I'm currently halfway through a Python project, but would like a review before I spend too much more time on this to avoid going too far down a rabbit hole. I had previously wanted to use HTML, CSS, ...
136
votes
17answers
16k views

Disproving Euler proposition by brute force in C

I wrote a little bit of code to brute force disprove the Euler proposition that states: $$a^4 + b^4 + c^4 = d^4$$ has no solution when \$a\$, \$b\$, \$c\$, \$d\$ are positive integers. I'm no ...
38
votes
2answers
407k views

Snake game in C++

This is my version of the Snake game, written in C++. How could it be improved, and what general advice would be useful for future projects? ...
32
votes
7answers
6k views

Project Euler #7 10001st prime

I decided to start working on the Euler project exercises. I'm doing fine for now but the seventh problem is running quite slow and I can't think of anything to make it work faster. It takes around ...
39
votes
2answers
4k views

Hello, Brainfuck

It has been bugging me for a while that while I understand how the basics of Brainfuck works, I can't get a firm grasp on the advanced features of the language. So I started to re-evaluate what I know ...
24
votes
3answers
95k views

Brute force password-cracker

I am just coding some classic brute force password cracking program, just to improve myself. I've explained how my program works at the start of the code. Check some of those screenshots to ...
19
votes
3answers
13k views

TicTacToe logic in Java

I'm currently studying Java by myself. The book I'm using (while very good) lacks feedback (obviously). While trying to write this program, I found myself solving most of the problems I've ...
38
votes
4answers
5k views

Everyone loves Fibonacci

I was bored and burnt out on more serious projects.... until I saw this Computerphile video on YouTube. Now I'm inspired again. Now I feel like spending some time implementing that recursive algorithm ...
13
votes
3answers
7k views

Basic user registration code

My first attempt at a user registration code. Login.php defines database log in variables (e.g. Database name, Table name, etc) ...
12
votes
3answers
470 views

RPSLS is less messy now, but is it clean?

This is a follow up to the following questions: RPSLS Game in C# Ensuring user input is an integer in a range I haven't made my way to DecideWinner() yet, but ...
11
votes
3answers
2k views

RattleHiss (fizzbuzz in python)

This is an iterative review. The previous iteration can be found here. The next iteration can be found here I've now been programming in python for all of 4 hours. At 70 lines it's rather verbose ...
11
votes
2answers
9k views

Binary Calculator in Java

I'm a beginner in Java and I tried to create a program that will perform basic arithmetic operations on binary numbers. BinaryOperations class: ...
8
votes
2answers
18k views

STL Stack Implementation

I implemented std::stack from the STL for deeper understanding of the language and memory since I still am only a beginner. I implemented the stack using a singly ...
14
votes
1answer
1k views

A wounded Zombie finder, or: how to find the almost dead undead?

The Zombies are on their way to eat our statistics. Fortunately, we have a way to get rid of them: our votes. However, we need to find them first. The /unanswered section is too large and contains ...
14
votes
2answers
3k views

O PC, why are you so slow?

In order to test some software I've written, I need to write values to a test harness with OLE for Process Control (OPC). The problem is, for a larger range of values I'm generating points for (say ...
14
votes
1answer
15k views

Command-line noughts and crosses

I've just got a Raspberry Pi, so I thought I'd try my hand at some Python. This is my first ever Python program (hurrah!). It's a very simple command-line implementation of noughts and crosses. The ...
12
votes
4answers
2k views

Countdown program in x86 NASM

I am fairly new to Assembly language programming and, for practice, I gave myself a problem: count down from 10 and right after 1, say "Blast off!". ...
10
votes
5answers
2k views

Beginnings of a Poker hand classifier part 2

Part 1 - Beginnings of a Poker hand classifier I'm a beginner programmer I've been working on a poker hand classifier to improve my object orientation and programming skills, I've improved and ...
8
votes
3answers
37k views

Text-based Blackjack game in Python

I am new to programming in Python and wrote a simple Blackjack project. I am looking for experienced peers to provide a high level code review about the overall design patterns and proper usages. The ...
5
votes
4answers
15k views

Find the binary gap of a number N

For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of ...
5
votes
1answer
120 views

A Simple Cluster Generator v0.31

[NOTE] This question can be depreciated in favor of version 0.32. This is a code revision of a previous post and works well. The purpose of this code is to produce a universe of points, randomly ...
3
votes
4answers
2k views

Summing up distinct elements in steps

My current task is to find a score from an array where the highest/lowest scores have been taken away, and if the highest/lowest occur more than once (ONLY if they occur more than once), one of them ...
27
votes
4answers
6k views

Is it Friday yet?

This is the first program that I have written in my C++ saga that I actually think is useful. The description for this assignment is kinda long and mundane though: Write a program that inputs a ...
24
votes
6answers
2k views

Print out table with start/end temperatures and step size

I am trying to learn C++ by myself. I looked up a sample question after going through some text. Though I would like someone to review my code. I'm basically asking you to break it to show some flaws ...
18
votes
5answers
4k views

Self-made Linked List

I was tasked by my teacher with making a linked list by myself, so I could understand the concept better. Here is the MyLinkedList class: ...
12
votes
1answer
4k views

Decompression implementation

Here is a simple decompression implementation. I'd very much appreciate any advice or comments about the structure/logic of the program, style of the code, or reusability of the features. I'm a real ...
10
votes
2answers
180 views

Associating degrees with notes of scales

I have a JS file that creates an object with notes from a music scale when given a key (aka tonic/ note). The code works and does what I want it to do. I need a critique on the way it's written, what ...
9
votes
8answers
3k views

Temperature conversion application

I'm two months in a programming course and our instructor told us we should think about building real-world applications as to gain valuable experience. I got the idea of doing a simple temperature ...