Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
0
votes
0answers
13 views
Mastermind game - Evaluating the guess in Ruby
I am a novice coder and I am very new to algorithms. Something about my code leads me to believe that it is unnecessarily verbose and/or inefficient. I am building a command line Mastermind game, and ...
0
votes
0answers
22 views
Splitwise clone done right
I have started this project basically for learning perspective and wanted to learn good object oriented design. What I am trying to do is making clone of something like this but this is a command line ...
3
votes
2answers
35 views
Graph representation implementation
I wanted to represent graphs in Python, and wrote the following class. I don't care about values associated with nodes or the weights of the connections between them, simply the connections between ...
4
votes
2answers
69 views
Class template for beginners
I want to allow anyone that has never coded to make classes depending on my template with little to no knowledge of Python.
These classes need to do 2 things:
Inherit from other classes similar to ...
1
vote
1answer
32 views
Tic Tac Toe in Ruby
I'm a novice programmer going through the Odin Project. I just finished up building a command line Tic Tac Toe game and I would appreciate some feedback on object-oriented design, methods, verbosity, ...
4
votes
3answers
93 views
Vending Machine class
I am looking for ways to improve the code that I wrote for this.
Consider a simple vending machine class. The machine accepts tokens
and dispenses cans of refreshing beverages. Write a complete ...
0
votes
0answers
23 views
Subclass Method Return Type [on hold]
I'm trying to allow the enduser to filter their data and then provide output based on the selected Report instance and date range. My Report hierarchy is setup using Entity Framework (TPH). Currently,...
4
votes
2answers
29 views
Parse Run Length Encoded file for cellular automaton data
I wanted to be able to parse Run Length Encoded (*.rle) files into something usable for a cellular automaton simulator (e.g. Conway's Game of Life and such).
Here ...
-3
votes
0answers
39 views
Bowling Game with JUnit tests [on hold]
Is it possible to rewrite this code without arrays?
The Game class:
...
0
votes
0answers
35 views
Assignment of Array to Property in class constructor
I'm writing classes to decode and persist Message's sent via TCP. Each message contains many DataField's. I have a simple class DataField class that holds some ...
6
votes
2answers
46 views
Activity Assigner - that randomly assigns each student to an activity
I am trying to improve my object-oriented modelling and programming skills and hence made an attempt at solving the problem statement from this link.
Problem Statement
A teacher wants you to help ...
5
votes
1answer
120 views
Command-line blackjack for up to 6 players in Python
Here is command-line blackjack for up to 6 players (not including dealer). Would love any and all feedback!
...
-3
votes
0answers
9 views
Inheritance: Pass values in constructor or override method [closed]
If you have multiple classes inheriting from ParentClass, and ParentClass needs to access a specific value from each child class,...
1
vote
1answer
29 views
Creating and calling objects sequentially in Tkinter with Python 3
I am trying to build a very simple user interface in Python 3 using Tkinter to be used in windows. and have written a code which is not efficient - it is excessively long for no good reason. I am ...
7
votes
1answer
184 views
C++ Quiz game w/questions in random order
This is a 10 question quiz that assess's the user's knowledge of the C++ programming language. Upon the start of the program some ASCII welcome art prints. The questions, answers, and correct answer ...
3
votes
1answer
32 views
Inventory of objects with item types and quantities
I am thinking about how an inventory could be designed. The requirements for this inventory will be the following:
There will be predefined item types in the inventory.
The user can define new item ...
0
votes
2answers
42 views
0
votes
0answers
19 views
PHP: Best way to implement model layer in MVC [closed]
I've been working with PHP for few years.
Till now i'm still confused about designing model layer in MVC model because somehow MVC model againsts OOP style.
In the MVC, model layer in charge of ...
5
votes
0answers
47 views
Python-style object library for Clojure
Background
I am authoring pulley.objective, an Open Source library that provides an object system inspired by Python's object model. I have some features ...
2
votes
1answer
54 views
OOP PHP for handling upvoting
kinda new to OOP, and I wanna know if i'm heading into the right direction. Also I should mention I'm not using AJAX
AnswerVoteManager.php
...
-1
votes
0answers
15 views
Using inheritance to make a 2d tic tac toe game into a 3d tic tac toe game [closed]
I was tasked with making a 2d tic tac toe game utilizing OOP concepts. I did that fairly easily, but now when tasked with making a 3x3x3 tic tac toe game by use of inheritance to create derived ...
1
vote
2answers
77 views
One object to handle all my database manipulation needs
I have created an object to handle all my database manipulation needs. Here is my object constructor and one of its functions:
...
0
votes
0answers
23 views
find the two longest word made of other words [closed]
I want to find two longest words from array ,made from smaller words.
my code are given below.
current out put is:
catxdogcatsrat,
ratcatdogcat,
catsdogcats,
dogcatsdog
required output is:
...
7
votes
1answer
88 views
Text-based adventure game using classes and XML
I am studying software engineering and we just started learning about object oriented programing. I wanted to be a bit ahead of all others, so I decided to write a little text-adventure using classes.
...
2
votes
0answers
25 views
1
vote
0answers
43 views
Ruby - Asteroids Remake
After some feedback on my last Ruby Code I decided to start another one with two big concerns in mind:
Trying to adequate my coding to the OOP paradigm
Trying to follow the Ruby Style-Guideliness
I ...
3
votes
2answers
69 views
Creating a model record for a database
I'm trying to expand my use of classes and better understand how/when to use them. Please review the code and let me know if I'm on the right track or where I need to make improvements. For example, ...
5
votes
2answers
91 views
Connect Four (the OO approach)
I saw some approaches to the connect four game on a site. None of them seemed very OO like.
Therefore I'd like to present my implementation and request suggestions on how to make this code more ...
4
votes
2answers
63 views
Python REST API clients
I am working on a project right now, where we need to search different APIs, then clean & persists data to database and finally pushing to Elasticsearch.
The high level code looks like this:
<...
5
votes
1answer
70 views
Generating RPG Characters (Objects)
I am a beginner Java programmer. I have just finished up an assignment and would appreciate some advice and/or constructive criticism on my program. I am trying to ensure I do not advance my knowledge ...
6
votes
1answer
90 views
Designing a toy dependency injection library
Just for learning purpose I thought to write a simple and useful dependency injection service which would just do dependency injection but also it should expose its core too which would let the client ...
4
votes
3answers
92 views
Generating 50 Random Shapes
I am a beginner Java programmer. I have just finished up an assignment and would appreciate some advice and/or constructive criticism on my program. For context, I have the assignment details, ...
2
votes
1answer
97 views
Modelling an account manager in OOP
I have this task of modelling a system where given a group of users each can keep track of their expenses. The basic requirements are as followed:
To be able to give credit to an user.
Find all the ...
3
votes
2answers
63 views
Loading items from XML document
I'm making a game in Unity and I need to have a inventory/item system, I decided to store my items in simple XML document which I later read from. I'm planning to have different varieties of items and ...
2
votes
1answer
73 views
Defusing a bomb using a state machine
This code is a solution for /r/daily_programmer #293.
The idea of this challenge is, you are given input in the form of colored wires:
...
4
votes
0answers
67 views
Test and implementation of a reorderable data structure that stores number of users (classifiable as per gender, country, etc.) of an Application
I have implemented a data structure that allows storage of number of users of a hypothetical application in a tree-like data structure in nodes as per their classification based on categories such as ...
5
votes
4answers
702 views
Generic Null/Empty check for each property of a class
I have created a method to check for null/empty values of class properties and if any null property is found I'm stopping the checking process and returning the result as true. I'm used a solution ...
3
votes
2answers
68 views
Singleton Pattern + unavoidable Public Constructor
We have an object that needs to be converted to a different type before storing it in database. For that purpose, the library provides an annotation over the field that specifies the appropriate class[...
2
votes
1answer
70 views
Refactored game of Snake
A week ago I requested a review of my code for a game of Snake.
First game of Snake
I made some changes based on your answers and now I want to show you present code. Something else to modify here?
...
10
votes
4answers
1k views
C++ quiz game with 25 questions
I created a quiz game program with 25 questions, 4 answer choices, correct answer and 4 points awarded per question. I realize this code isn't the best; I am still a beginner and this is my first ...
3
votes
1answer
60 views
Managing documents with manager class
So I have a program that visualizes data from files (csv,txt,etc.). These files are saved to database as individual tables. In my application I have DocumentExplorer...
6
votes
0answers
58 views
Battleships Player vs Computer Algorithm
I am a Year 12 student studying CS for my A-Levels. I have had previous Python experience but it is obviously not to professional/industry standard. Therefore, my goal for this review is for my code ...
2
votes
1answer
49 views
Simple class to mimic a dynamic array
for my c++ class I was asked to write a class with the following characteristics:
Implement a vector replacement that operates only on integers (you don't need to use templates like the normal STL)...
3
votes
1answer
47 views
List abstraction using array
Following this reference, below is the list abstraction implementation using array,
...
5
votes
4answers
123 views
Loosely coupled movement
I'm working on my ability to write loosely coupled applications that follow SOLID principles. This is a simple application trying to demonstrate the concept. Is it OK? Am I going along the right lines?...
0
votes
2answers
46 views
No getter/setter on model with many instance vars
I have been reading a lot of material on how to become better in OOP, DDD etc. While reading Object calisthenics and Getters/Setters. Evil. Period. I got confused. Let me explain it by example.
I ...
3
votes
2answers
176 views
First game of Snake
I'm making baby steps in Java programming and I just ended coding basic game: Snake. Could you share with me what is needed to improve in this code? What about OOP here?
GameBoard.java
...
4
votes
1answer
32 views
Framework for composing algorithms
I am implementing a game in python, which will give the user a sample encryption, and explain each step from plaintext to cipher. The task for the player is to decrypt a word by undoing each step ...
4
votes
2answers
102 views
PHP OOP Login Script
I'm new to both PHP and OOP and would like some constructive feedback on a class I made.
I have a "main account" login system already setup and working; when the user logs in they're presented with a ...
1
vote
1answer
69 views