instruction
stringlengths
71
71.9k
I was asked to write a test code for an exercise for a job I applied for. I was rejected, and I didn't know why. And I want to ask your opinions about my code. The exercise is like that: Write a simple class in the language of your choice to represent a deck of cards with operations to shuffle the deck and to deal o...
I've been having problems with a client where the server would move a file on the server, the client would then try and access that file but get a FileNotFoundException. We believe this is due to the client not synchronising to the server properly. To get around this I wrote the following method to wait for the file to...
I'm working on animation and I want to organize my code in best way I'm new in android and not know too much about this. Here is my code that I'm using to animate views TestClick public class TestClick implements OnClickListener { Context context; ImageView iv1,iv2,iv3; public static boolean bActive = false; publi...
I'm new in Python TDD and I would like to ask you about some feedback for Django unit testing. import datetime from decimal import Decimal from django.test import TestCase, RequestFactory from django.core.urlresolvers import reverse from cart.models import Cart, CartItem from cart.mixins import get_cart from cart.conte...
As a small project to refresh my C and data-structure knowledge, I decided to write a generic ArrayList (as in Java). This is my most current version: ArrayList.h: #ifndef ARRAYLIST_H #define ARRAYLIST_H struct ArrayList; // ArrayList_create: {{{ // Creates a new ArrayList in memory and returns a pointer to it. // /...
If someone wants to make a review of this bad code i'd be more than happy :) I do know i'm far from a programmer but i've just started and looking for small tips and stuff. import java.util.*; import javax.swing.JOptionPane; public class Game { public static void main(String[] args) { Scanner sc = new Scanner(S...
Here is my code for hacker rank question. Can somebody suggest improvement? Question: We consider a word, to be beautiful if the following two conditions are satisfied: No two consecutive characters are the same. No two consecutive characters are in the following vowel set: a, e, i, o, u, y. Note that we consider y...
What would be the best way to refactor this class - if any at all? I'm using this class to get the current date and time and also to modify this date by being able to change its date and time. I have a lot of functions which appear to do similar things subtractSeconds, subtractMinutes, subtractDays etc.. But I'm not ...
A few weeks ago, I had started to write a text-editor in C++ using SFML library. The work is now paused pretty much because I am a lazy freak. So, I thought I might use this passive time to get reviews on what I have done so far. As of now, I want to get reviews on the cursor module (for displaying a blinking cursor), ...
If std::vector<vector<pair<int,int> > > v(n) represents the adjacency list of the graph with pair<int,int> is the {vertex,weight} pair, I tried to implement the algorithm the following way: while(true) { long long yo = LLONG_MAX; int ind=-1; for(int i=0;i<n;++i) ...
I'm refactoring some code, essentially a dot-notation walker for objects. I've abstracted things quite a bit, I'm to the point any more and I begin to loose readability. It all hinges on this one function objectWalker, which does the actual object traversals. I can control what happens by passing in different callbacks...
I have written a slow solution to the Memorise Me problem on hackerearth The first line of input will contain N, an integer, which is the total number of numbers shown to your team. The second line of input contains N space separated integers. The third line of input contains an integer Q, denoting the total numbe...
Preface I have decided to let my pet project created some years ago to undergo a code review here. The review will be broken into parts according to meta question Multiple reviews or one big review?. The overall concept and motivation can be inspected here (be patient, it takes some time to load). The doxygen generate...
I have written an implementation for sentence generation using Markov Chains. Would be great if you could review it. #!/usr/bin/env python # -*- coding: utf-8 -*- import os import random from markovipy.utils import get_word_list from markovipy.utils import list_to_tuple from markovipy.constants import PUNCTUATIONS ...
Preface I have decided to let my pet project created some years ago to undergo a code review here. The review will be broken into parts according to meta question Multiple reviews or one big review?. The overall concept and motivation can be inspected here (be patient, it takes some time to load). The doxygen generate...
I have created a router/micro-framework. I have split my code into multiple files by responsibility. All files are in the same directory. Would you recommend any way of improving it ? The most important one for a performance is a tree.go file. This is a benchmark results for 4 cors CPU. $ go test -bench=. -cpu=4 Benchm...
import java.util.Scanner; public class CAI { public static void main(String[] args) { Scanner cai = new Scanner(System.in); System.out.println("Caluclator"); System.out.println("\nHere are your options:"); System.out.println("\n1. Addition"); System.out.println("2. Sub...
Problem :Given two sorted arrays, merge them to form a new array of unique items. If an item is present in both arrays, it should be part of the resulting array if and only if it appears in both arrays the same number of times. e.g.: a = [1, 3, 40, 40, 50, 60, 60, 60] and b = [2, 40, 40, 50, 50, 65], should retu...
This program uses the C language. What's used are two points, and the usage of the inverse tan function finds the angle of the line between the two points. Afterward, it finds the cardinal direction on the plane. -y is south, +y is north. It seems to work quite well. However, I want to find what is unconventional of my...
Is there a way to speed up the Linq.Any check or perform the check in another way to enhance performance. I have a mastercodes table that records unique codes for a campaign. The code below will create new codes for a campaign but checks the mastercode table to make sure that it doesn;t already exist. Once the codes...
I have written a code that will parse JSON file from a cuckoo report. The issue is am not a good coder. I have got the program to give me the desired output. The real challenge that I am facing is I have written multiple file open and close. How can I reduce it to a minimum? Because the JSON file are huge and the parsi...
Create an application named TestNewspaperAd that instantiates and displays a ClassifiedAd object. A ClassifiedAd has fields for number of words and a price. Include get and set properties for the number of words but only a get property for the price--the price should be calculated at nine cents per word. You can creat...
I'm working on this pure JS slider. It's quite a basic one, but it's what I need. I would like your feedback on it and any improvements/features that I'm missing. HTML <div class="container"> <ul id="slides"> <li class="slide showing">Slide 1</li> <li class="slide">Slide 2</li> <li class="slide">Slide 3</li...
I have the code below and I am looking for input as to how I can improve it. The main question here is should the code at the top in razor brackets be moved to the Controller and returned via a ViewModel? The underlying question being, particularly when the code isnt controling styling is should the endeavour be to hav...
I am learning SQL today, so I decided to practice by writing some queries for The Nineteenth Byte Data Explorer. This is a PostgreSQL database about messages from The Nineteenth Byte chatroom, created by El'endia Starman. The schema can be found at the bottom of the page. The code functions correctly (as far as I can t...
I have a directory with lot of files and folders in it. The function which I wrote works, but I want to make it more efficient and faster. I was thinking of multiprocessing or threading. The code which I wrote is as follows: LIST.delete(0,END) # this is a list view usePATH = '/nfzcae/nvh_mdp/Messdatenbank_Powertrain' ...
I have written some simple code for evaluating expressions. However, I am not sure how well I am following conventions (this is my first time trying to). Specs for problem: All binary operators (+, -, *, /), no unary - or + Uses PEMDAS My code is: import re import time DIGITS = '0123456789' OPS = '+-*/^' OP_FUNCS = ...
Tell me how to speed up the removal of empty folders / files ? string[] dirs = Directory.EnumerateDirectories(str1, "*", SearchOption.AllDirectories).ToArray(); DirectoryInfo dirInfo = new DirectoryInfo(str1); for (int i = dirs.Length - 1; i >= 0; i--) { if (Directory.EnumerateFileSystemEntries(dirs[i]).Count() == 0...
I have written this code for fun. I'd like to hear your suggestions about how to make it more compact and pythonic. from random import shuffle class Pool(object): """ Simple object that allows to sort """ def __init__(self): """ During initalization the final grid containing or...
My code actually works. I was just wondering if there was alternative ways, maybe even more efficient ways of coding my program. This is suppose to be a game of drawing stick, and it's recording the score after each game. If I'm missing anything can someone let me know? Sort of new at this. Here is my code: import UIKi...
I have a requirement to download multiple files using POST request. So I am using form submit to get this done. I have followed two approaches to accomplish this. Create a Form. Fill input details with payload data. Then set the target of the Form to _self then manually submit the Form. But I see few problems with thi...
I've written a tool to store a files history more efficiently by only generating diffs and storing them whereas whole file would otherwise have to be stored. I would like to to hear about ways to improve readability and otherwise make this code more "ruby" or suggestions for test-cases to improve robustness. I also fee...
I need to read Numeric Data from a text file that looks like this: 2 cell X-cord Y-cord 1 1.1 2.2 2 2.1 2.0 The first line indicates the dimension (2 or 3), the second line is just trash. The file can be comma separated, so it may look like this: 3 cell X-cord Y-Cord Z-Cord 1, 1.1, 2.2, 3.2 Of cour...
I have written a small tool to generate a json file from sqlalchemy models files to automate the tedious procedure of writing all the sql raws in a json format. The script works, but there are few parts, see get_modules function, that can be improved. I would be glad to have a review of this code. Thanks # -*- coding: ...
I made a Powerball lottery simulator in C. I chose C because it is fast. Here's how it plays: The user plays one ticket every day. The user can choose to play the same ticket every day or a different ticket every day. The numbers on each ticket are a "quick pick" -- that is, randomly generated. The program also genera...
This is a self-teaching implementation to get files for a given directory in order to simplify os.Walk in Go (avoid to pass a func for recursively walking across the files and directories). I'm pretty new to the language and feel there is already something wrong with the way the structure ""implements"" the interface....
This is a Delphi class, based on System.net.HTTPClient with a function for downloading a file from a URL and saving on a filename destination: function Download(const ASrcUrl : string; const ADestFileName : string): Boolean; The main feature is the ability to suspend or resume partial download. unit AcHTTPClient; int...
I have some code which aligns the sequence of two strings, I am doing numbers just for my implementation. I was wondering whether there are any performance enhancements I could make as the code itself is \$O(n^2)\$ which isn't ideal in terms of scalability, here's the code: int[] goal = {1, 2, 3, 4, 5, 6, 7, 8,...
I have written this code to shuffle a deck of cards. I would like to hear your inputs. public static class Helper { public static Int32 GetRandomNo(this RNGCryptoServiceProvider rng, byte[] data) { rng.GetBytes(data); var randomNo = BitConverter.ToInt32(data, 0); return randomNo; } ...
I have the following code that simulates the monty hall problem (see google for more details). I used sets to do it but is there a more intuitive or efficient way to do it? import random as r from sets import Set def montysim(N): K = 0 for i in range(N): s = Set([1,2,3]) doorstoswitch = Set([1,2,3]) ca...
I found myself needed zip but for dictionaries, and wanted to know if there is any way I can make this shorter and more concise, and/or faster. Also I cannot figure out what the type hinting might be for the return (I would like to put it in the reStructuredText). def dict_zip(*args): """The zip utility but for dic...
This code starts when the page loads and when all assets become available, it removes pre-loader animation and page becomes visible. I know some functions has code repetition, but it can await refactoring stage. For now, I want to understand the basics of good code architecture creation. (function() { 'use strict'; ...
my code is for menu. In the exit case of the menu it must count how many times are used options 1 and 2. No matter how many times I choose 1 and 2, when I choose 3 it gives me 0 for counter1 and counter2 and I can't find out why. The code for passive class: public final class Service { private int x; pub...
Two participants, A and B, are playing the following game: The initial set of games is a sequence of zeroes and ones. A and B change turns, and participant A always moves first. During each turn, a player removes one element from the sequence that satisfies the following: It is not the first or last element. It mu...
I've written a simple bookmarklet to go to the YouTube channel RSS feed URL from at least any video or channel page: javascript:(function () { var newLocation = function () { var url; Array.prototype.slice.call(document.getElementsByTagName('link')).forEach(function (element) { if (eleme...
I tried to make a Python function to generate present tense Spanish conjugations. from unidecode import unidecode def solveSpanishPresent(pronoun,verb): if unidecode(verb).endswith("ar"): arDict = {"yo": "o", "tú": "as", "usted": "a", "él": "a", "ella": "a", "nosotros": "amos", "vosotros": "áis", "ustedes": "an"...
I have written code responsible for saving data to a file using Serialization. I think that a natural way to avoid repetition is to use inheritance but I'm not sure if it would work because of generics. How can I remove all the repetition in the below code? Some general information: There is a class StoredItem and cl...
Inspired by Test-Driven Development with Python by Harry Percival, I'm trying to implement functional testing of a PyQt GUI. I'm finding that, in order for tests to find the GUI components, I need the actual code to include lots of .setObjectName lines as a "hook". This makes the actual program code very redundant. For...
I have a version of the N-Queens problem in Java. I have function that returns the column placement for each row. And another function that takes that and translates it to a board with '.' representing blanks and 'Q' representing the queens. I was hoping to get an opinion on this. public class Solution { public Lis...
I'm using Rails with MongoDB for database. In my apps I have 1 action for displaying list of users. User has name, image, score and is_online attributes. The list of users is displayed after ordering with multiple fields (score and is_online) and paging them. I should now get all users and order by is_online and score ...
I'm writing a C++ application for POSIX environment with terminal-based User Interface. I'd like to make my application's UI be consistent between Ctrl-Z and fg(i.e: SIGSTOP and SIGCONT). Here is a minimal example (without using longjmp. this code uses C and POSIX headers only, but entire application will be C++): #inc...
Problem (Skiing): Each number represents the elevation of that area of the mountain. From each area (i.e. box) in the grid, you can go north, south, east, west - but only if the elevation of the area you are going into is less than the one you are in (i.e. you can only ski downhill). You can start anywhere on the...
Given the following JSON data containing 4 articles by 4 different authors: const data = { "DataSet": { "Article": [ { "Title": 'A', "AuthorList": { "Author": [{ "FirstName": "Al", "LastName": "Ab", "Initials": "A" }, { "Fir...
I recently started learning C# and am taking the opportunity to try and accelerate my introduction by helping the RubberDuck team (Website and GitHub Repo). The full class code that I'm working on can be found here. Its purpose is to create a Module in VBA that will allow unit testing. Since FakesFieldDeclarationForma...
I would like to know what are the drawbacks of setting values this way: class PersonFactory { public function createPerson($firstName = null, $lastName = null, $separator = null) { $person = new Person(); $person ->setFirstName($firstName) ->setLastName($lastName) ...
The following code extracts command line parameters and modifies argc and argv parameters of the. After all parameters are read remaining values (especially after --) are remaining. Please keep following questions in mind while reviewing: Is it good practice to modify argc and argv? How to make clear to the caller the...
I wrote something to "compress" svg files. The svg files I am using often have comments and empty <g> tags, and I want to remove them. My main goal is not the speed of the compression, but the size of the compressed svg file. Here is an example svg file: https://image.flaticon.com/icons/svg/222/222436.svg And here is t...
For a small system I need the Country Code mapped to the country name (e.g. "GB"-> "United Kingdom"). To accomplish that I read a JSON file and save it to a dictionary using swiftyJSON. Is there a cleaner and better way than I did: fileprivate func loadNames() { if let filePath = Bundle.main.path(forResource: "cou...
I'm learning Java JDK 1.8 since one day and I'm using Java's methods to the first time. I have never used Java before because I'm a Python/Django developer. I created a method which let to get energy in function of two parameters: mass and light speed. I would like to know if my method is well-written or if I made some...
I am making countdown app with multiple records, so I am using UITableView to show that records and countdown dates. What I do is just take one timer and reload cells on every second. Is this a best approach to reload visible cells on every second or is there another better approach there? updateCellContentsTimer = Tim...
A widget-based Qt application has to run on a wide variety of platforms, some of which don't include fonts at all. Therefore I created a global font loader utility class, with the justification that the fonts are used in a large number of classes, and it would look bloated to pass around the fonts everywhere using depe...
I'm currently writing some of my first assembly code for a new project, I am applying a small non-recursive filter algorithm to some saw tooth wave data held in memory, in order to blunt the edges. Using thumb2 instruction set on a cortex m3. The algorithm being used is: y[0] = x[-2]/8 + x[-1]/8 + x[0]/4 + x[1]/8 + x...
I am working in JavaFX and I created util class which is responsible for creating new window. I called this class WindowUtil. Depending on the button that was clicked I want to: Open new window Send some data to controller of this window (this is optional) The problem is that code responsible for opening a new window...
I have a program which parse HTML content to get a script src attribute and script attribute. A function have directory (contain HTML files) as input and extract to other directory as output. However, I think my code is not clean. The following is my code. def extract_int_js(src, dst): for file in os.listdir(src):...
I have made a sliding puzzle solver which is currently for 8-puzzles only. It works too slowly even though it is based on an A* algorithm whose f-score is calculated on the basis of Manhattan Distance and Linear Conflicts. But it solves all the cases correctly. I would like to improve the time and space consumption of ...
Let's take the following example. Even if the number of parameters is acceptable, I find that the code block is too long. Are these validations at the right place? Is there a better approach in such cases? public function __construct( array $config, EntityManager $em, EventDispatcherInterface $dispatcher ) ...
I have come up with a problem online about the next biggest palindrome of a number and i have solved the problem by two different approaches in python. The first one is, t = long(raw_input()) for i in range(t): a = (raw_input()) a = str(int(a) + 1) palin = "" oddOrEven = len(a) % 2 if oddOrEven: ...
Most of the time I used datetime fields, but for this project it is a requirement to use time fields. The problem is calculations with 2 times not on the same date. I.E.: 23:00 to 03:00 is 4 hours. In vba I'm using the following code: Me.TotalTime = IIf(Round(CCur(Nz(DateDiff("n", [startTime], [endTime]) / 60, 0)), 2) ...
I have solved this kata on Codewars.com and it passes all tests. I am looking for refactoring tips and proper coding tips as well. Also I am a beginner that is trying to Improve. I would like to shorten my code and clean it up. Task In the Land Of Chess, bishops don't really like each other. In fact, when two bishops h...
This was a straightforward test for a junior level position. The README.md estimated completion should take 45 minutes. Provided were class and function stubs to complete and several unit tests which StackExchange won't let me link to due to my reputation (they are reproduced below). I'd love to offer belabored rationa...
I'm creating a Banking system program using Python, and the requirements of this program are very basic: Register and maintain Customer Details Update Account balance through Deposits and Withdrawals I've managed to program the basic functionality, and now I'm in need of any feedback on how to improve my code, in ord...
This is my first unit testing and also my first React project. I'm coming from an AngularJS background, but in terms of testing, this is my first try. I spent some time reading about tests and I got even more confused than before. Some say to test only the basic functionality, so you don't overkill your code. Some say ...
I have a custom exception hierarchy in C++ to detect unexpected cases in a library I am implementing. The base exception class inherits from std::exception and all other exception classes derive from this base class. The header file for the base exception class is as follows: #ifndef LibException_H_ #define LibExceptio...
I have the following code implemented in C# for NHibernate: public class UnitOfWork : IDisposable { private ISession _session; private ITransaction _transaction; public UnitOfWork() { _session = NHibernateHelper.OpenSession(); _transaction = _session.BeginTransaction()...
I have a program, that works, I just feel that it is running slower than it should and I feel that it is a bit more unstable than it should be. I am looking for tips on writing "better" code and making my program more stable. I am looking to better this part of my code for now: Private Sub Worksheet_Activate() Appl...
I'm currently learning Swift and today I created my first application, a simple calculator. My main goal was to practice and create something without any help. After a few hours my application was ready for use but of course not perfect. After overlooking my code I noticed that there are areas which I should improve. F...
I'm re-designing the login functionality for our application, and the first thing I came across is something a previous developer wrote a while back. There's a simple Login class that just contains 2 strings, username and password, and an enum LoginStatus: public enum LoginStatus { LoggedIn, LoggedOut } I'm th...
I have code which returns whether or not a sliding tile puzzle state is solvable. I was wondering whether there is any way I could either make the code a bit more readable or increase the performance in any way. public boolean isSolvable(int[] puzzle) { int parity = 0; int gridWidth = (int) Math.sqrt(...
Overview I am looking for feedback on this (personal) project that I am working on that is rapidly becoming quite complex. I am fully aware that this is horrific code quality... I just want to get my bearing so that I can start writing cleaner code. What it is I am trying to create a classroom type environment that is ...
The problem is: loop through a list of numbers and for each one of them get the product of all the others and return a new array. For example in [1,2,3,4,5] the third element should be 40 because 1 × 2 × 4 × 5 = 40 I'm looking for feedback on efficiency and good practices. function main(numbers) { var result = []...
This program needs to detect strings in which the first few characters are 'a', than few 'b'. Is it possible that in this implementation may be undefined behavior. string str; while (cin >> str) { unsigned int i = 0; while (str[i] == 'a' && i < str.length()) { i++; } while (str[i] == 'b' && i <...
I'm giving the repository + UoW patterns my first shot on the server side, so bear with me. Also, it's worth mentioning that I haven't used an IoC container on the server side before either, so I'll post its setup too. I'm using simple injector at the moment. All kinds of feedback is appreciated, especially for UnitOfW...
Since I want to try writing my own language at some point, I wanted to have some experience writing an interpreter. BrainFuck is the simplest language I (kind of) know, so I decided to try writing an interpreter for it. Going in, I decided to use a parsing concept I never fully learned when I used to write Haskell. Bas...
So, I have decided to make a little "guessing game" where the user tries to decode what the encoded piece of text prompted. I'm sure it works. However, I know that there are places where I can improve. I am open to any constructive criticism about this. This program was done in HTML + JavaScript. <!DOCTYPE HTML> <HT...
The following code seems to work ok to remove a node from a linked list: bool remove(node * & head, int toBeRemoved) { if (head == nullptr) //empty list return false; else { node * temp = head; //the first node needs to be removed if (head->data == toBeRemoved) { head...
I was curious which U.S. president had the lowest approval rating for each day in their presidency. For example, which president had the lowest approval rating on day 42, and what was the rating. I downloaded the data from here and built this code to visualize it. I'm particularly interested in feedback regarding anyt...
I have a 3D data set made of a certain number of points (x,y,z) that cover a certain region of space. Using the scatteredInterpolant object I can interpolate this data set over a grid to produce a rectangular mesh. Note that the mesh may extend to regions that are not defined by the data set; in fact, after the mesh ge...
I would like to implement a higher level design pattern here but I am a bit stumped, How can I improve this code and make it more object oriented? import __builtin__ import logging import requests import json import datetime from string import Template from resource_helpers.abort_logger import AbortLogger CONNECTION_A...
This was the assignment: Here’s a self check that really covers everything so far. You may have heard of the infinite monkey theorem? The theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works ...
One of the first Haskell puzzles on http://exercism.io/ is to implement a leap year check. I've done this twice. Using pattern matching: isLeapYear :: Integer -> Bool isLeapYear year | year `mod` 400 == 0 = True | year `mod` 100 == 0 = False | year `mod` 4 == 0 = True | otherwise = False Using the ...
I asked a similar question (C++ linked list) but I'd like to have this similar code reviewed. It's not the same code, just slightly different and with bugs fixed. The code takes the head pointer of a singly linked list and an int element to find and remove from the list: void removeFromList(node* &head, int toBeRemoved...
For a personal project, I need to parse YAML file. I chose to use C-based libYAML instead of yaml-cpp, because: I try to keep my dependencies to what's commonly installed and Debian statistics show 45% installs already have libYAML, vs 0.5% for yaml-cpp. I don't need variant node types, as the config parser that uses ...
I am currently working on my own little game engine and thought about implementing a simplified version of Unitys component system where you can attach objects of derived Components to an GameObject. Later you can request specific Components to use their functionality. Below is a stripped down (but still working) versi...
I have started to create a console app, which I am testing locally on my mac. The idea is to generate an ssh key and structure the storage of these keys within the .ssh folder. My thought behind this is for my digital ocean ssh keys, and so I am using a folder structure dictated by the droplet name and user. i.e /users...
I work for a service desk in a Windows 7 environment. Recently we have had an issue where (do to an update) when users are attempting to map printers to themselves they are not able to open the devices and printers tray, it just loads endlessly. I've figured out a solution for this via the following: Open up services....
Write a function called longest which will take a string of space-separated words and will return the longest one. My code: function longest(str) { var words = arguments.split(" "); var words_count = words.length; var longest_word_length = 0; for(var i = 0; i < words_count; i++){ if(longest_word_length < ...
I am trying to determine if there is a better way to handle reversals for this function. This is how it works: A user inputs in amount, bank, and account number this would be used to debit his virtual wallet like so: models.sequelize.transaction(function(t){ Q.fcall(function(){ console.log("this is amount...
I just started learning about functional programming, and thought I would have a look at writing a simple object comparer as the basis for my implementation. Below is my result. My assumption (in writing) is that functional code is intended to not modify external state, and not have side effects. If I functional style ...
At the outset, I am a beginner at python, having started out about 2 weeks back. Aim- To create a GUI program, that can adequately work as a buzzer-management system. A buzzer, like those used in quizzes, should display who pressed the switch first, and also, who is currently pressing their switch. Arduino part- With ...
Me and my friend are trying to build a Connect4 game with a twist. The twist requires us to have a 7*7 board and to be always able to check all possibilities for a win for both players after each move. Currently, we are just filling the board with a random distribution of 0,1 and 2 (in the final game it will be 0 for e...