instruction
stringlengths
71
71.9k
I'm working on an Entity Component System library. Right know I'm trying to clean up the Entity/Component part (only the code which manage the data). But I have a class which I think is not really readable. Maybe the implementation can be improved too, but I reduced the implementation to be small and fast, so it's not ...
This program I made takes a word as an input and prints all the anagrams of the word in a given word base from a txt file. I would like advice for code style, Java specific practices etc as I'm new to to the Java language (about 2 months). import java.io.File; import java.io.FileNotFoundException; import java.util.Arra...
Challenge There are n citizens voting in this year's HackLand election. Each voter writes the name of their chosen candidate on a ballot and places it in a ballot box. The candidate with the highest number of votes wins the election; if two or more candidates have the same number of votes, then the tied candidates' na...
Here is my implementation of Huffman encoding using min-heap approach mentioned in this Wikipedia page. I'm looking for advice, using Python 2.7. import heapq from collections import defaultdict class TreeNode: def __init__(self, name, left, right, value): self.name = name self.left = left s...
I coded two answers to this challenge. The first one was a standard attempt, but after it timed out, I figured out the "trick" to solving the problem much more simply. However, I'd still appreciate comments and critiques on my first attempt, because there will be other problems that will need a long approach and I'd li...
I started implementing algorithms to learn them in order to get better at programming. Here is a merge sort one and criticisms / optimizations are welcome. import unittest import random def mergeSort(list): """Sorts a mutable list. Args: list: An unordered list Returns: The sorted list. "...
This is a take on Pebble Solitaire. The user inputs n number of games and after that inputs a strings of length 23 that contains a combinations of only 'o' (pebble) and '-' (empty space). If there are 2 adjacent pebbles and an empty space on either side, ie (oo- OR -oo), then you remove the middle pebble and you swap o...
I made a class capable of moving Polygons around on a Polygon in a mostly smooth manner. Disclaimer: this was part of a school project (thus the use of Polygon rather than Image), but this code is entirely outside of the scope of the assignment, and the assignment has already been graded. The project was a Bejeweled cl...
Based on this question, I have written my own implementation of the Go Fish game, with the following features: Full trace of all actions that happen in the game More than 2 players possible Each of the players can be a computer or a human As a debugging aid, it is possible to see the computer player's hands by setting...
I am doing a project and I have come up with some code to swap every letter with every other letter in a string, only the project was to be "efficient as possible". Example: "rya" = yra, ray, ayr.. etc I understand exactly how the code works. I would just like to make it efficient as possible. public String testSwap(S...
I am going through "Haskell Programming from first principles" for the first time and I would like to get some pointers on what can be improved in my code, which is the following: module DaPhone ( stringToKeyTaps , fingerTaps , mostPopularLetter , mostPopularWord , coolestLt...
Inputs are two sorted lists (of the same length) of numbers. I would like to return a new merged, sorted new list. I have written the following code, but most lines are used to deal with the end case. I am wondering if there is any better way to write it. def merge(array1,array2): result = [0]*len(array1)*2 i ...
Link to SQLite wrapper func queryAll() -> [(String, String, String)] { do { let sql = try DB?.prepare("SELECT city, zip , temp FROM weather") var arr : [(city : String, zip : String, temp : String)] = [] for row in sql! { arr += [(city: row[0] as! String, zip: row[1] as! String,...
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 her write a program that will randomly assign each of her students to an activity at the various activity tables available ...
The textbook problem: (strictly identical arrays) Two arrays list1[] and list2[] are strictly identical if they have the same length and list1[] is equal to list2[] for each[i]. Write a function that returns true if list1 and list2 are strictly identical using the following header: bool strictlyEqual(const int l...
for (long i = 2; i <= numberOfRows; i++) { string quarry = "=IF(J"+i+"<10000,J"+i+"*0.05,IF(J"+i+ "<30000,(J" + i + "-10000)*0.1+500,IF(J" + i + "<70000,(J" + i + "-30000)*0.15+2500,IF(J" + i + "<140000,(J" + i + "-70000)*0.2+8500,IF(J" + i + "<250000,(J" + i + "-140000)*0.25+22500,IF(J" + i + "<500000,(J" ...
im new in VBA making, so all code below is still working tho but it takes a lot of line of codes. Even it is easier to maintain but if someone can simplify my noob-code to cut some lines and more eye-pleasing? there are more than 20 toggle buttons in my userform this is the example of my code, need help for make it sim...
This is a follow up to my previous review request. BitEx is a Python module I've been working on for a little over 9 months now, as a side project. It was published 6 months ago on GitHub, and as I edge closer to my 1.0 release, I wanted to take the opportunity to present my code on here, in order to straighten it out...
I've been writing a basic script to enumerate SMTP users (via a user dictionary) on poorly configured SMTP servers. In scripts like this, I usually see arguments handled as follows: if (len(sys.argv) != 3: print "Usage: ..." sys.exit(0) I found the if and print statement approach irritating, but without a conc...
Edit: I made a new calculator after taking your input New Calculator I made this three-function calculator. I have been learning C for a couple of months, and I learned C++ through the internet. This is my first "real" program in C++, it started really messy but I did a lot of refining and debuging and deleting unneces...
I'm working again on the 3D model of a building in order to parse in JSON every parameters of every objects of the model. My program works well but it is too slow because of the huge number of information : about ~10k objects each containing ~20 parameters. In order to get a lighter JSON we organize it this way : { ...
I have made a program to weigh bags of money, and calculate whether too many/little coins are in the bags, and the difference. bagWeight = 0 totalCoinsAdd = 0 totalCoinsRemoved = 0 totalBagsChecked = 0 def inputs(): global bagWeight global totalCoinsAdd global totalCoinsRemoved #The above grabs th...
Recently I made simple hangman game in Java. Main.java package com.company; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Type a passwords"); String word = input...
I would like to implement service with explicit interface implementation. I don't want to have public methods in service, only possible way to create instance is trough interface. I am not sure what is best way to call method of same class if method is explicit implementation of interface method. You can see in my code...
I am a newbie to Java. I will be glad to hear your opinion with regards to this LinkedList implementation. The Iterators are self implemented by my decision: public interface Iterator { public boolean hasNext(); public Object Next(); } public class LinkedList { private Node mBase; private class L...
I have coded a very simple error class that will allow me to display errors if they should happen. For example, if a file is missing or a database connection couldn't be established I would display a nice error, instead of revealing an ugly PHP error to them. <?php defined('LATRINA') or exit('You cannot view this file....
I'm attempting to learn more about Haskell by completing a "hobby" project - a simple API to save/retrieve content for pages - used with Hakyll to generate static sites. I have got something working for the tasks of retrieving all of the content for a site, and for adding a new page to a site. Hooray! However, the code...
Advent of Code is a fun competition. Here is a link to the first day. Each day has two parts. --- Day 1: No Time for a Taxicab --- Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is regulated by stars. Unfortunately, the stars have been stolen... by the Easter Bunny. ...
I wrote an application that has a modular structure. Each module communicates with different remote servers. Time for execution of a task in each module varies. So communication should be asynchron. Plus some restrictions like flexibility, scalability and so on are put. So i decided to use CompletableFutures to build ...
Update: Here is Take 2. I want a slideshow with three primary pieces of functionality: Has text links that act as bullet-points and can jump directly to a slide when clicked. Pauses when a slide or link is moused over. Resumes resumes playing from the currently active slide if the user clicks a link. This is what I ...
I've got a item inventory that each inventory item is tagged with multiple tags. What I've got is an API that takes a query parameter with multiple comma separated query items and returns a list of all items that match all of the tags. The following code is working, however this isn't really using the ManyToMany attrib...
After looking at a post on CR I found that pointers to member functions are incredibly hard to use, especially as callbacks. The current solution doesn't solve the problem mentioned in the linked post, but tries to get rid of the type erasure (i.e. std::function<>) by making the target type explicit. I tried to solve l...
I'm on my second revision of this workbook and I've brought the run-time down from 37 seconds to 9 seconds on my computer and from 30-40 minutes to 8 minutes on my boss's old laptop. I'd like to know if there is anything I can do to further increase the speed of this code that I may have missed. I took 3-4 subs and mo...
I am building a backend APi for which I need to extract query filters from request URL of following pattern: http://api.com/v1/users?filters=filters=(name like 'Milk' and name eq 'Eggs') and age ge 2.55` The URL can contain complex filters like: 127.0.0.1:5000/v1/users?filters=(name like 'Milk' and name eq 'mil') and ...
Running Office 2007, I have master workbook with data, which I: Split master sheet data to new sheets for every salesmen Create new workbook (with 1 sheet) Put sheets of salesmen to an array according their manager Copy array of sheets to new workbook Delete first sheet on newly created workbook, save it as .xlsx and ...
I am fairly new to Factories and Dependency Injection in MVVM. I've build my View(Window) factory with help from SO, and I would like to know if I had implemented everything properly(code works just fine). I'm sorry for the length, but there was no other way for me to show my complete example. First, there is the Win...
I am attempting to find folders based on their last modified dates. import os, shutil, stat, errno, time, datetime srcFolders = "C:\Users\Test\Desktop\Test" archiveDate = datetime.datetime.strptime("2016/11/20", '%Y/%m/%d') os.chdir(srcFolders) for name in os.listdir('.'): if os.path.isdir(name): modifiedD...
Day 5: How About a Nice Game of Chess? You are faced with a security door designed by Easter Bunny engineers that seem to have acquired most of their security knowledge by watching hacking movies. The eight-character password for the door is generated one character at a time by finding the MD5 hash of some Door ...
This function finds the 8 char passcode from a given "doorId". Is there a way to find the passcode in an undetermined number of steps without using a while? Maybe involving streams? val passcode = stream(logic).take(8). def findPassCode(doorId: String): String = { var passcode = "" var count = 0 while (passcode....
Assume I have a cache: import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future trait Cache[K, V] { def put(key: K, value: V): Future[Unit] def get(key: K): Future[Option[V]] def remove(key: K): Future[Unit] def getOrElse(key: K)(ifNotFound: => V): Future[V] = { apply(key) ...
Here is my code for simplifying a Unix path. Any advice is highly appreciated, including higher efficiency from an algorithm time complexity perspective, or any bugs. ''' Simplify Unix path Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", =>...
I would like to re-render my WPF chart control when data source is changed. My minimum requirement for a data source is IEnumerable<Point> but it could be also ObservableCollection<Point> or BindingList<Point>, so collection change notifications are sometimes becoming available. Chart Serie class (simplified): class Se...
I'm working on a problem to sort array by low, medium and high -- in-place tweak original array. I'm looking for advice, especially any algorithm implementation efficiency. My current bottleneck of implementation is that I have to do partition twice, by low+medium and high, then do low and medium partition on low+mediu...
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 is my main method which has the code I used for manual testing. The example file is taken from the above linked wiki. def main(): sample_rle = \ """#N G...
This is my crude attempt at implementing a counting sort algorithm. My goal is to be able to sort lists of ints, negative and positive. As you can see I've employed such hacks as return res[1:] to get by. I'd appreciate any feedback I can get to make this a more pythonic implementation. def find_min(a_list): min = ...
I recently got feedback for a programming assignment that was positive but mentioned that 'some things could be done better', and I was wondering if anybody here might be able to give me a more specific idea of what could to be improved & why. There's quite a bit of code, but as I'm at a very introductory level I'm ho...
I am learning Rust and finding it quite a difficult but rewarding and fun challenge to learn how to write idiomatic and succinct, clean code in it. I have written the following simple naive JavaScript scanner code as an exercise to learn some basics of Rust. While it works, it feels like it is far from ideal Rust code...
I have completed the following coding exercise. However, I got poor result for testing. I need some help to find out what is missed, incorrect, or incomplete in the testing section. I would appreciate it if anyone could please point out any mistake in the testing section or possibly any improvement in the related secti...
I'm assigning a HEX-Value to a byte in a byte array and then send this byte array to a serial port. If the value is bigger than 255 the corresponding HEX-Value is supposed to be split into two. Example: 750 = 0x2EE so A[0] = 0x2 and A[1] = 0xEE Is this an efficient way to do the task that I want it to do? From what I r...
I have a java application that migrates data from one database to another. I have to do update data in my database with data from another database. Another database provided by the customer. Now it is this way: I make a request from java application to my database(oracle) to get the address and driver of database, user...
A python program made with a friend to draw n dimensional hyper-cubes in python using turtle. Any suggestions for improvement. import turtle from turtle import * import time import math n = int(input("How many dimensions?: ")) length = int(input("How long is each side?: ")) angle = (math.pi/180)*float(input("Angle: "...
The stepping number: A number is called as a stepping number if the adjacent digits have a difference of 1. e.g 123 is stepping number, but 358 is not a stepping number. Example: N = 10, M = 20 All stepping numbers are 10, 12 Return the numbers in sorted order. The code I wrote does accomplish what is asked, but...
I didn't know whether it was best to start with the general task I'm trying to solve, or the meat of the programming problem. They're both below but the former is rather long and solving the latter may not require it, so feel free to skip at will. The task to be solved I'm running a relatively simple dynamical simulati...
Following these two SO questions: Find duplicates for mixed type values in dictionaries Group similar dict entries as a tuple of keys I came to the conclusion that the solution I proposed is mature enough to be reviewed here. The idea is to find duplicates in a dictionary such as example below, but with extended su...
Here is a code I would need to make far faster: it is made to analyse more than 3000 DNA sequences of more than 100 000 characters each. The matter is I have to compare it by pair, so that would be around 3000*2999/2 = 4498500 calculation and each takes 1 to 2 seconds... Could you think of another way of doing it ? I...
I was testing the RGB color mechanic on Excel, so I did the following: sub paint() red = 255 blue = 0 green = 0 Max = 48 For col = 1 To Max For Row = 1 To Max Cells(Row, col).Interior.Color = RGB(red - col * Int(256 / (Max * 2)) - Row * Int(256 / (Max * 2)), green + col * Int(256 / Max), blue + Row * Int(25...
I wrote a script that adapts HTML tabs for different screen resolutions. On a small screen it's an Accordion and on wider ones they're Tabs. The script is for a production site, and I'm not so good in JavaScript yet, so show me any weaknesses. (function ($) { // html structure // div - selector // // ul // // //...
The idea of the program is to serve as a data accumulator collecting monthly expenditure from a user and later display it. I wanted to implement classes/methods and just basic stuff that I understand to help me get better at writing better C++ programs. This program works and does what I want it to do, but I figure sin...
The code I have is based on BFS and a little bit of Dijkstra and returns the shortest path of an unweighted directed graph as an integer. I was wondering if someone could take a look at my code too see if anything could be changed or improved: public int bfsshortestpath (V source, V target) { Map<V, Integer> dist =...
I recently started working with asyncio and coroutines. I have a coroutine that runs every 0.25 seconds to print "running ..." on screen indefinitely. When the script receives a SIGTERM or SIGINT it will exit gracefully. I figured out that there are two ways to do that. Method A: Run a while True: loop in the coroutin...
While solving one question I got stuck with a time limit error. The main objective in question is to count numbers in an array \$A\$ that are either divisible by \$P\$, \$Q\$ or both. Input format: The first line contains a single integer \$N\$ denoting the size of array \$A\$. The next line contains \$N\$ space sep...
I have this short Python script for making images brighter: import skimage.io import math import sys def square_root_filter(input_image_file_name, output_image_file_name): image_data = skimage.io.imread(input_image_file_name) image_data_height = len(image_data) image_data_width = len(image_da...
im using the following code which is working. The code provide range of random values but unique one i.e. it doesn't return the same values until the full range was provided ,what do you think and doest in ES6 there is shorter way to achieve this? var range = [10, 20]; var not = []; function randomRange(range, n) { ...
What do you think about my code? I am a beginner and just started doing some algorithmic exercises to sharpen up my python skills. Here is code for problem #1: """If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the mu...
I just started learning the basics to Swift 3 about 2 days ago. Since then, I've decided to make a simple calculator that can only do one operation at a time. I was wondering how efficient this was and what I could possibly do to make it more efficient. Any type of criticism would be helpful too import UIKit class Vi...
Just for curiosity I have done some benchmark for testing the best performance between switch, binary-search, and if-else statement. here is the code : package switchStatement type Badge struct { score int badge string } func initiateBadges() []Badge { badge := []Badge{ {score: 4501, badge: "gol...
I tried to solve the Advent of Code quiz for day 5 in Go, since my brute force algorithm wasn't efficient in Ruby. I solved the first part of the quiz with the following Go code. package main import ( "crypto/md5" "encoding/hex" "fmt" "strings" ) func main() { fmt.Println("Pas...
The goal is: I can add many services as I need. I can add many taxes as I need (the idea is that services has all of this taxes) Calculate per services each tax value Sum all the taxes of each service and throw me the total value per service. This is the first attempt at making a JavaScript program and I would lo...
For the sake of training my vanilla JS skills I've decided to make a simple ToDo list with the following features: Tasks can be added with a priority (higher the number - higher on the list) Counter tells how many tasks are left to be completed The "delete" button deletes the according task whether it's completed ...
This is my implementation of pricing an exotic option (in this case an up-and-in barrier option) using the Monte Carlo simulation in Python. I use NumPy where I can. Any ideas to optimize this code? ################################################ # Exotic Barrier Option (up-and-in) Pricer # By: DudeWah ##############...
This is written to find percentages of three subjects. Original HackerRank practice problem is here. Input Format The first line contains the integer N, the number of students. The next N lines contains the name and marks obtained by that student separated by a space. The final line contains the name of a particular ...
I've recently begun a project in digital signal processing and am using C++ as the programming language. In this project, I have implemented several finite impulse response (FIR) filters. Many of these FIR filters have the same interface, but are implemented differently depending on what can be optimized. To remove the...
I developed a script to transform a Japanese word in Furigana thanks to the jisho website. But the code is very ugly, especially the extractHiraganaFromHTML and filterBetween functions. What kind of improvements are possible? module Main where import Network.HTTP import Network.URI import Text.HTML.TagSoup import Data...
I'm considering how to refactor code to make it clean & clear. There are some principles to make code clean; in this case I think it's Single Responsibility and One level of abstraction. The original code is like this: for (int i = 0; i < header.length; i++) { if (header[i].equals(Constant.ID)) { indexOfID = i; ...
I am writing a program that reads from DB and outputs to a CSV file. Besides the regular columnar data there are 2 JSON fields data as well. The table layout looks like this (other fields removed for brevity): +----+--------------+-------------+-----------------------+ | ID | Product_Type | Json_Data | Demographic_Qu...
I'm new to multithreading in C so I made a toy program that uses a mutex and a conditional variable to communicate between two threads. do_work performs a task every 1 second (task could take longer than 1 second). Is this implementation free from deadlocks and race conditions? Anything else I might be missing? #inclu...
This sample code is correct and no error however this only good if you only have few hundreds or thousand datas but if you have million queries this takes time how we can improve this algorithm namespace :auto_status do desc "Add Status to the Tracking code Automaticaly" task make_status: :environment do ...
I was trying to sort a massive file of successive chars in C. I did some research and found a few file sorting algorithms that look the same. Their main idea is to read an amount of data to memory, sort them using one of classic sort algorithms, write them to a new file, then repeat the process and merge the two files ...
The problem is from the cracking coding Interview programming book. The problem is that: Sort Stack: Write a program to sort a stack such that the smallest items are on the top. You can use an additional temporary stack, but you may not copy the elements into any other data structure (such as an array). Below ...
My company is cheap but wanted a way to pinpoint bandwidth on certain computers. Me being a programming guy came up with the following small program. I just wanted some expert opinion on my code. I am especially interested in you opinion on how I usually pull permanent variables. I usually put these variables in a ...
I'm working on a DSL for web development, similar to sinatra. The git repository is here. I've been attempting to improve this code and write it for 4 months, and as a hobby programmer, I would like to have an evaluation of general readability/maintainability, and any ways I could more logically split up my code into f...
I made a game in python, where the objective is to catch a 'turtle'. The controls are the arrow keys. #Catch the turtle import turtle import math import random score = 0 print ("\n" * 40) print("Your score is:\n0") #Title t=turtle.Pen() t.pencolor("Blue") t.hideturtle() t.penup() t.setposition(-70,350) t.write("Catc...
I have this function that allows the user to supply a number and that many rows are appended to the existing table: $('#add-row').click(function() { if($('#insert-rows-amnt').val() < 1) { alert('Please enter number of rows to insert'); } else { for(i = 1; i <= $('#insert-rows-amnt').val(); i++) ...
I've written some code to tokenize a command string into its tokens. A token is either: A block of any non-whitespace characters A block of characters, which may include whitespace, wrapped in quotes So, for the input: This is some text "with information" quoted. I'd expect the tokens: This is some text with info...
I wrote a program to automatically optimize my Brainfuck source files. It works well, but the optimizations are only trivial ones and probably there are still some other points to improve. def main(): print "Enter the path of a brainfuck source file you want to optimize" path = raw_input() if path in ('exi...
does someone has any opinions about this SafeBox StateMachine? import java.util.Scanner; public class SafeBoxStateMachine { public enum SafeBox { ACCEPT{ private Scanner scan; private boolean askPassword(SafeBoxStateMachine safebox){ System.out.println("Pleas...
I have this plugin that I have finally finished the big pieces of, there's one or two minor details that are not yet implemented do to lack of a decision yet but everything else is there. I wrote it and can follow fine but I feel it reads very haphazardly. Could someone with fresh eyes help me make this into a more pro...
From SICP Exercise 1.45: We saw in 1.3.3 that attempting to compute square roots by naively finding a fixed point of x/y does not converge, and that this can be fixed by average damping. The same method works for finding cube roots as fixed points of the average-damped x/y^2. Unfortunately, the process does no...
This is a battleship console game I wrote in C++. #include <string> #include <iostream> #include <process.h> #include <cstdlib> #include <time.h> using namespace std; int const ROW = 3; int const COL = 3; int subX, subY; int guesses = 5; int board[ROW][COL]; bool hasWon = false; void winScreen() { cou...
I am very new to coding and really started a few weeks ago for a new job I have. out of necessity, I am slowly learning VBA (which I can't say is very easy...) I started by recording macros in Excel and copy/paste bits of VBA codes from the internet. A good chunk of them came from SO, which prompted me to join and try ...
It make sense to not allow links to external code hosting, so I restated my question. This is classical cons list in python using Abstract Base Class interface. Constructor is in fact out of the Cons class, but I didn't see the way to put recursive code inside init. # immutable, cons list and few methods class Nil: ...
I'm reading an array (of unknown length) of modules package.json files in order to extract the "style" property and store it in an array of its own: var gulp = require('gulp') , path = require('path') , Promise = require('bluebird') , fs = Promise.promisifyAll(require('fs-extra')); let components = [ 'comp1'...
I have recently been getting into the habit of leveraging the revealing module pattern for all my code. I used this guide for inspiration, but my code doesn't feel as elegant. var styleGuide = (function styleGuideHandler() { 'use strict'; var publicAPI, intervalId = null, clipbo...
I'm solving some puzzles to learn Rust. A problem I faced is to turn a string of 3 integers into 3 integers. I succeeded with the following example: fn main() { let mut it = " 455 123 42 ".split_whitespace(); let (a, b, c) = match (it.next(), it.next(), it.next()) { (Some(a), Some(b), Some(c)) =>...
I've made a short program to determine if a string is permutation of another string. Example input/output : a) 123, 112 <- False b) 123, 321 <- True c) 112, 121 <- these don't count as permutations since they have duplicate characters private static void Main() { string a = Console.ReadLine(); ...
In (this) Poker you have 2 hole cards that are combined with 5 shared cards on the board. Each player makes the best 5 card hand from the seven. Believe it or not that is over 2 billion runs to do them all. I'm trying to create statistics for 2 known hole cards against random boards and random hands for a single oppone...
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 class (on the next page) as described below: The class has two instance data fields; one to keep track of the number of ...
Is this a good solution for FizzBuzz? What can I do better? for num in range(1, 101): if num % 3 == 0: if num % 5 == 0: print("FizzBuzz") else: print("Fizz") elif num % 5 == 0: print("Buzz") else: print(num)
I am quite an experienced developer but I am quite new to JS/frontend/functional programming and I am working with react-native in my day-job now. I'm trying to do my own flux implementation to better understand redux. My goal is to have a performant data store that will behave predictably. This solution seems to be wo...
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, etc. Here is the code for the main menu/high level game control: require "./game.rb" require "./player.rb" require "./...