instruction
stringlengths
71
71.9k
I wrote this code in Java using the Jaunt library. The program scrapes all words from Wiktionary from category "English_uncountable_nouns". And after save each world to text file. I am not sure that exceptions are handled in best way, so I'm looking for tips on how to make this code easier to understand and more stable...
I am using Scroll Magic for the first time and I am in general very new to JavaScript/jQuery. I got it to work but it is very messy and repetitive code. Here is the fiddle. This is the messy code (I just gave this as an example, in my project there is about 50 scenes after each other in this manner!): var controller = ...
I have the following controller: angular.module("UserRoles") .controller("UserRolesController", function($http, $scope){ $scope.usersearch = ""; $scope.users = []; $scope.roles = { } $scope.getusers = function(){ $http.get("/api/finduser/"+$scope.usersearch) .success(function(d...
I’ve written a small utility tool capable of backing up a directory, restoring a backed up directory, syncing two directories (copying missing or changed files from src to dst). I’d love your feedback - any code smells, improvements, potential bugs, non-idiomatic approaches, etc., please let me know. Here's how I ba...
I recently created a custom static class in C# to encode, hopefully, any object it is given (or collection of objects), because I was, at the time, unaware of a native C# library that did the same thing. I am using Generics instead of System.Object because I am aware of the overhead that comes with boxing/unboxing. Af...
I am currently using the following glsl code to retrieve separate textures from a tile atlas: #version 330 core in vec2 TexCoord; out vec4 color; uniform sampler2D image; void main() { //width and height in tiles of atlas int width = 8; int height = 8; //x and y position of a tile in the atlas int...
I've created two classes that contain only sudoku logic. One class Sudoku generates sudoku grid and returns SudokuGrid object with has specific number of values in it(removing values from filled grid). Second class SudokuGrid contains all logic that player needs, checking whether any rules are broken. In my opinion Sud...
In our automated test framework, written in Java 8, there are different entities representing test data, having different states and transitions between them. To model this behavior, I started to implement a simple finite state machine (or at least what I understand as a FSM). The idea to use it would be like this: pub...
You are first confronted by three links. Each link triggers divs to slide out. The divs slide out and up to appear as if unfolding. The slide back in reverse when any other link on the page is clicked. The code works exactly how we want it to. However, the code is very long and needs re-developing into a neater script....
I have just finished the sololearn C++ course and wanted to create a basic login program in the vein of a basic operating system. #include "ubuntu_login" #include <iostream> #include <string> using namespace std; Ubuntu_Login::Ubuntu_Login() { cout << "\t Welcome to Ubuntu!\n" << endl; } void Ubuntu_Login::usr_lo...
def triangularNumber(n): if(n == 1): return 1 else: return triangularNumbers(n-1)+n works great to find the nth triangular number up to 996... I get some error in the recursion after 996. But can tell what it is because it just keeps running through the loop. Anyone see the error?
I took all your suggestions to heart and I think it improved the code a lot. The Map got it's own typedef: IntStrDict. It's a perfectly applicable name, but I can't help but feel it's not according to best practices. The code now accepts arguments. If no arguments are given, the code fails. If one or more argument is g...
I made a MS Word style ribbon header, but it all seems very hacky, and I'm not really sure how to simplify it to something more reasonable. Rolling over one of the navigation icons changes the related z-index to positive revealing it. Then, on hover it changes its own z-index to remain positive keeping it up even when ...
These classes are to count keys in a text file. The file has key, value pair like these examples: John, 12 Sara, 2 Adam, 19 John, 1 Adam, 3 and the main class FileKeyCounter prints output as: The total for John is 13. The total for Sara 2. The total for Adam is 22. It consists of 3 classes: FileKeyCounter: This...
I've just made a github repository for a simple packet scout in C#. It is my first time using C# (other than Neoaxis 3D engine logic) since I am more familiar with C#. Below is the main bulk of the code that I'd like to improve. You can see all of the code here. If you have any suggestions please share them. using Syst...
I'm using the Observer design pattern in order to manage events in the game I'm currently developing. I based myself on the implementation demonstrated here but improved it in order to ease its use. class Observer { public: virtual ~Observer() {} virtual void onNotify(Subject * entity, Event event) = 0; priva...
I am currently self-studying Java using the resources available on the internet (Stanford's cs106a introduction to programming lecture). I am still a beginner, and I hope that I can improve my coding skill after receiving some feedback here. This is a program that plays 2-player Tic Tac Toe (I might add an AI feature i...
I would appreciate any feedback you could offer. I'm self-learning, so I don't really know a "standard" that my code should be up to. I'm also not sure how to get rid of that bit of logic at the bottom, or if it's acceptable. class Board attr_reader :board, :place def initialize @board = [1, 2, 3, 4, ...
I recently discovered the file_get_contents function and wanted to put it to some use, alongside preg_match_all, off the information in this Stack Overflow thread. <?php //use a site with lots of email address on. $string = file_get_contents("https://stackoverflow.com/questions/3901070/in-php-how-do-i-extract-m...
I'm trying to create a class that's able to 'crawl' through a generic 2D matrix. Crawling through a Bitmap (which can be viewed as a 2D Matrix of Colors) should yield the same result of a flood fill. So the first thing I did was create a IMatrix (previous name was I2DMatrix. I renamed it since i don't intend to code a ...
I had this code repeated in many Actions: public ActionResult History(int? patientId) { if (patientId == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } var patient = patientService.GetPatient(patientId.Value); if (patient == null) ...
This code parses mail server log files and outputs statistics into an external file. Is there a way to make it more pythonic? Is it a good idea to use regex anywhere? Which libraries can reduce the length of code? import sys deferred_as_error = '--deferred-as-error' in sys.argv # {session id: email} logged_in = dict...
I am combining two lists of separate objects into a single combined list. The below code works perfectly but it is not the most elegant or efficient solution. Is there a better solution? var articles = context.Articles.Where(a => a.Author.ID == authorID).ToList(); var reviews = context.Reviews.Where(a => a.Author.ID ==...
To learn Haskell, I've been going at this challenge, which is to check a list of phone numbers to ensure that no number is a prefix of another. However, my code is way too slow. I am really new to Haskell so I don't know what to look for in performance optimization. I have generated a sample input which takes 5s (uncom...
I want to find the intersection of two lists of dicts. Note that equality—i.e.: what is to appear in the intersection—is given by which keys they must have equal. See the obj_equal_on function. def obj_equal_on(obj0, obj1, keys): for key in keys: if obj0.get(key, False) != obj1.get(key, None): r...
I have written this helper function. I want to know if there is an even better approach, considering that I do not want to add a dependency to any additional module. def _isobjectInList(lst, name, criteria='startswith'): """ Find item in the list starting or ending with name passed. :param lst: list of it...
The purpose of this code is to get data from the database and output it into a multidimensional array in JSON for my web app. But my gut instinct is telling me this code is way too messy and just generally badly written. // Structure of user_medication http://i.imgur.com/gTrZm7B.png public function getUserMedication($...
I wrote a simple little script, designed to load some log file. Clearing lines and loading updates is done by double clicking on the log line to clear. <html lang="en"> <head> <meta charset="utf-8"> <title></title> <style> pre { margin: 0; } </style> <script> var chunks = []; v...
This program reads a filename from standard input and then prints its content. Please review: #include <unistd.h> #include <fcntl.h> #include <stdio.h> #include <errno.h> int main() { char fileName[20]; // Get the filename from the user: int fileNameLength = read(0,fileName,19); // We need to get rid...
I was needing to provide the hex-dump of a code, but I needed to create my own. And, for fun, I decided to do it. function hex_dump( $value ) { $start_time = microtime(true); switch( gettype( $value ) ) { case 'string': $lines = array_map( function( $line ){ ...
I'm trying to solve a challenge where you need to calculate the median every time you add a number. say you have a list of numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 When you scan in the first number (1), you calculate the median of that. When you scan in the second number (2), you calculate the median of 1 and 2, and so...
I have implemented a couple of functions in python as part of an online course. Although the functions seem to work fine I feel that the code is inefficient with a lot of nested loops. Are there any improvements I can make? I am new to the language so any advice is welcome. Here is the code and some simple tests: def m...
This is a followup of this question. @Corbin made a very interesting review, and I re-wrote most of the code. function hex_dump( $value ) { $to_hex = function( $number ){ $hex = strtoupper( dechex( $number ) ); //if we don't check if the number is 0, it won't fill the whole space return ( $...
I'm building a website where all data interactions are done over ajax other than the initial page load. Now I discovered the need for CSRF tokens. I elected to deliver the token in a meta tag like so: <meta name="csrf" content="JI8qMif9gHuD06m/HByCzg==" /> The function that generates the token is as so: public functio...
I recently wrote a program involving a MySQL database using C#. The program is simple: it allows users to enter numbers and ensures that no same number is entered twice. Now I know that it is not efficient and I need help in order to improve the code. using System; using System.Collections.Generic; using System.Com...
I am going to send a C++ array to a Python function as NumPy array and get back another NumPy array. After consulting with NumPy documentation and some other threads and tweaking the code, the code is finally working but I would like to know if this code is written optimally considering the: Unnecessary copying of the...
Suppose in a School, you can only study, teach, or walk; in a Mall, you can only purchase, walk, or sell; Outdoor, you can only study or walk. These actions are all functions that can be called, but we only want to make the appropriate functions callable in the different location types. Here's my way of implementing...
I know it is a simple game, but what I am doing here is practice what I took in an AI course. I'm also playing a little with the canvas and trying to improve the readability of my code and using JavaScript as an object oriented language. I divided my code into 3 main classes (objects). Board class which represents th...
I have a list of items, and a list of actions that extract data from those items. I iterate over the list of items and create a Dictionary for each item that has the data extracted from the item. I have written a foreach based version to get the data, it works well but is a bit long. I could see that there is a shorter...
The program below was made for a game named CheckIO, and it works. I'm just wondering if there is any way to make the code more readable. edit: hi luke15g def checkio(maze_map): #the walls of the maze are already surrounded by 1's start_x,start_y=1,1 stop_x,stop_y=10,10 class Point: directions={...
I have the following problem statement: Modify a given list such that one specific element is "weaved" into that list. Examples if the element is 'module': [] remains [] ['a'] remains ['a'] ['a', 'b'] becomes ['a', 'module', 'b'] ['a', 'b', 'c'] becomes ['a', 'module', 'b', 'module', 'c'] I solved it using the foll...
I've been working on my new lighting system, at the moment it works really good but it has some bugs and color blending doesn't work as I want. Do you know some tricks to improve my code? the drawing system is based on pixel. this.draw = function(data, w, h) { var r = Math.floor(this.radius), ra = r * r...
The following program generates the S3 URL and response (status code?) for the key, provided the bucket name and if the S3 URL is a mess (wrong url), then it generates empty string as URL and error as the response. The code works fine, but the way it handles the messy S3 url seems buggy to me. Please provide some insig...
I have 1 client and 1 server. Client passes Java objects (throughput 10000/sec). I am using Netty. I am short on CPU and this code consumes a lot. I have to make Server1 (Netty Client) talk to Server2 (Netty Server). I do not expect any response from Netty Server (Any optimization on this point? e.g closing some events...
For a plugin I'm writing in jQuery, I have two optional parameters. For each parameter I do a check for its value. However, I'm curious if I can't write it shorter. jsFiddleiddle (function ($) { $.rgbGenerator = function (color, options) { var args = $.extend({ returnAsObj: false, ad...
How can I combine multiple DNS lookups without nesting a whole bunch of if else statements? How would this impact performance? I would ultimately like the function to lookup all DNS addresses simultaneously. function checkInternet(isConnected) { require('dns').lookup('a.root-servers.net', function (err) { i...
This program accepts either a 27 digit binary bar code of type string, or a 5 digit integer zip code of type int. The program can return a binary bar code of type string from a 5 digit zip code of type int or vise versa. I would like to know if this is a good implementation of a class. What would you suggest? I am also...
I'm writing a prototype for an application that uses MailKit and imap to connect to gmail. It's the first time I've used MailKit and I'm a bit stumped around the best way to do this. Essentially, I want to write an async method hosted in a class library that downloads emails based on a simple header text search and inv...
I'm a beginner to Java and OOP, and I would really like to learn how to better organize my code! Over the course of a month or two, I made a calculator program with little functions I thought of here and there with a few small jokes built into it. After looking at it a second time, I realized that it is extremely poorl...
I've just encountered this question and am trying to solve it using Java. Here is my solution to it, which may not be optimized or might not be right way to do it. Someone please review whether it is correct or there is some good way to do it. For focusing on logic, I have hard coded List creation and code repetition i...
After my Dialogue parser has parsed a dialogue, it needs to be validated. To that end, I have several checker classes that go through the lines of the Dialogue. These checker classes get huge as I add more and more features to them. Eventually they get intertwined with checks that they're not really meant to be doing, ...
@Annonomus Penguin, @QPaysTaxes, and I are building an engine for easy creation of text-based adventure games, like Zork. The engine is still in its early stages of development, and the following code is my prototype. Here's the library code. cactus.py class MapPosition(object): """ Describes data about a posi...
After figuring out DXGI, I wrote a class that combines the act of creating a window and its associated swap chain (as well as an OOP approach to messages). The class supports different window modes that are useful for games and editors, and handles XInput behind the scenes, combining gamepad, mouse, and keyboard contr...
I was reading a Java book and I came up with this kind of problem and I tried to solve it: Problem: Write an application that inputs one number consisting of five digits from the user, separates the number into its individual digits and prints the digits separated from one another by three spaces each. For example...
I've created a chessboard model in JavaScript that will eventually iterate through some moves of a championship game. I've created a board object and a piece constructor. I've also created all the pieces with their correct position on a typical chessboard by rank and file. I don't think I've created my move method corr...
The following code is used to access a shield which converts settings written over I2C to Servo output. I make use of the MRAA library since that's the default supported by my hardware. To prevent my I2C commands from being written all at the same time, I use setTimeout to wait a given amount of time before executing t...
This is a follow on question from one I asked a few days ago here: Single process blocking queue Using the comments I determined that there probably isn't a pre-built solution for this and so I have had a go at writing my own implementation using a PriorityBlockingQueue. In order to avoid propagation of poor code, bef...
This challenge is from Talent Buddy: Tweets per second Japan Castle in the Sky airing broke a Twitter record on August 3, 2013. At one point during the classic anime movie showing, people submitted 143,199 tweets per second. This particular spike was about 25 times greater than Twitter’s steady state. Given an ...
I'm using SQL Server 2014 with Visual Studio 2013. When I add a new record, identity column (seed 1, increment 1) "ID" increases by 1, and record added to the database. My table consist of two rows: ID, set identity, seed=1, increment=1 Column1, int Column2, nvarchar(10), Primary Key ID Column1 Date 1. 1 300...
Challenge description is here need to find the first non repeated character from the string: Write a program which finds the first non-repeated character in a string. Input sample: The first argument is a path to a file. The file contains strings. For example: yellow tooth Output sample: Print to stdout the first non...
Answering this SO question recently, I've developed the following code (based on a well-known Active Code recipe, as discussed here): wheel = [2,4,2,4,6,2,6,4,2,4,6,6,2,6,4,2,6,4,6,8,4,2,4,2, 4,8,6,4,6,2,4,6,2,6,6,4,2,4,6,2,6,4,2,4,2,10,2,10] wsize = 48 def primes(): yield from (2, 3, 5, 7) yield fro...
This very fast, simple sieve quickly finds 31 bit primes. It uses a memory efficient BitArray for odd numbers. How a 32 bit int is a 31 bit prime Since a prime number must be > 1, the sign bit has no bearing, leaving 31 bits to store the positive numbers. This differs from uint which truly would be 32 bit primes. See...
All that the program does is query a database that I have setup, when the user selects the returned fields, which are populated based on the selection of the field above it. The application is basically 3 classes: DbConnect: Generates queries that are sent to the database Nested - QueryFields: Contains all user-sel...
I decided that since I was learning AngularJS and Bootstrap, I'd be remiss not to post a FizzBuzz, but FizzBuzz bores me, so I've extended it. My version of FizzBuzz is configurable, and allows you to create an infinite number of different "Fizz", "Buzz" etc elements with whatever names you like. function element(nam...
I just wrote this C++ code in Visual Studio. The code is working fine but I wanted to ask whether my code is written in a safe way or not. #include "stdafx.h" #include <iostream> int input() { int x; std::cin >> x; return x % 2; } int main() { using namespace std; cout << "...
Basically, I have three sheets in my workbook where only the second and third worksheets are being used. I want to copy columns from the second sheet to the third sheet only if the column headings match. For example, the code will check the first row of sheet2 to check if it matches any of strings in an array and if it...
This is a script that creates a base dataframe from a sqlite database, adds data to it (also from SQLite), cleanse it and formats it all to an Excel file. I feel like it is incredibly verbose and my code could be simplified quite a bit. One thing I definitely want to do is eliminate the direct references to the db, /...
I am trying to create a script that shows my login modal on page load. I have a button that opens the register modal and closes the login modal if clicked. Here is the script I am using: $(document).ready(function(){ $('#loginmodal').modal('show') }); $(".hidelogopenreg").click( function() { $(...
I'm trying to solve exercises where I am required to use recursion. I wrote this: static String reverse(String word){ if(word.length()<2){ return word; } else{ int index = word.length() - 1; return word.charAt(index) + reverse(word.substring(0, index)); } } But the answer for th...
There was a task on Stack Overflow which quite obviously was too broad (it didn't have a solution provided or anything!) which was the following: Give an object oriented design for a game that has the following requirements: It is a game of cards. Cards can have four symbols - Hearts, Diamonds, Clubs, Leaves Cards...
Note that this problem is equivalent to finding the longest line segment defined by any two points in a collection of 3D coordinates, which may be an easier way to visualize the problem, and is almost certainly a version that has received more research. Essentially, given a List<Color> and this method... public static ...
I made a bigint class that can add unsigned unlimited precision integers by splitting number into chunks less than 9999, and if a part is bigger than 9999 I take mod 10000 and carry 1 to the next part. The adding function looks a bit messy as I had to make adjustments for the algorithm if rhs has more/less digits than...
This is my implementation for Sieve of Eratosthenes in Java.Please let me know how can I further improve my code: public static void main(String[] args) { ArrayList<Integer> numbers = new ArrayList<Integer>(); for (int i = 2; i <= 120; i++) { numbers.add(i); } int digit = 2; while (digit ...
I am trying to write a module that automatically subdivides div-elements, given some initial parameters. I've prepared the following jsfiddle. What I am doing at the moment is: Setting the width and height of the parent element. Setting the child elements to float left and assigning percentual width and height to the...
I have the following class: public class IssueWithComments : Issue { public IReadOnlyList<IssueComment> FullComments { get; set; } public IssueWithComments() : this(new List<IssueComment>()) { } public IssueWithComments(IEnumerable<IssueComment> comments) { FullComments = comme...
This is the problem: (Game: display a tic-tac-toe board) Display a frame that contains nine labels. A label may display an image icon for X or and image icon for O. What to display is randomly decided. Use the Math.random() method to generate an integer 0 or 1, which corresponds to displaying an X or O image icon. Thes...
I have rewritten my C Mandelbrot set image generator, including many suggestions given in my previous question (see: Mandelbrot image generator), as well as some recomendations by a friend. The total list of additions is as follows: Parallelisation (omp.h) typedef-ing of structures Implementing a better file-type (P6 ...
In my previous NQueens Code Review question, I received feedback saying that I should write a program that would find all solutions. This revised program should be more general than before. import java.util.*; public class RedoNQueens { public static void main(String[] args) { Scanner input = new Scanner(S...
I was trying to implement the sieve of Eratosthenes entirely by myself, using only what I have learned so far. Now I'm wondering what I can do to improve my code's readability. Optimizing the algorithm is not my goal for now. #include <iostream> #include <cmath> using namespace std; class num { private: static un...
I'm trying to figure out what the best way to do this is. I have a part on my website where people can search for a particular card based on multiple different factors. Like the name of the card, color, cost, etc. When the user types in the criteria, I send the information via ajax GET. So the url looks something like ...
I'm very happy with the performance, but I always try to optimize my code as much as possible. Since I plan on using the code in production, I feel more save posting it here first. I probably missed something obvious that could break everything. Let's start with the KVF class. Its job is loading / saving values to the ...
After several attempts to follow my intuition that this code can be refactored to something more DRY, I keep hitting road blocks. Hoping someone can see a refactor that might get me going in a nicer direction. I'm trying not to break anything out of this one code file, although, I suppose helper types could be placed i...
I am currently writing code for a UART communication in my firmware. I am getting an interrupt every byte received (meaning I don't get a chunk of data, 1 byte at a time but, in the sample below I store them into a chunk of data for simulating my data parsing only). I have a dynamic message length format, as shown in t...
I am trying to refactor a switch statement. I know that you can replace a switch with a Dictionary, or a strategy pattern but it kind of feels like overkill for what I have. Switch var filters = new List<ColumnFilter>(); switch (gridColumnDataType) { case "System.String": ...
CreateInputParameter is an overloaded function with 6 type overloads, is it possible to simplify the following code or is this as good as it gets? I wish to call it like this : CreateInputParameter( string , object ) like following code : private void AddInputParameter(string description, object value) { ...
Within a complicated Ruby project, I need to monitor the connection to a PostgreSQL database, as answered here. I use a thread for this purpose. Every few milliseconds, I invoke "consume_input" which will raise an exception of the database connection no longer exists. If might have been closed for a number of reasons, ...
I would like to have advice on this use of base class and derived class. This all works but is it a good way to achieve a SOLID class? public class ProductRepository : GenericDataExport { private const string DB_TABLE = "[dbo].[ReplenEdit]"; private int rowsUpdated; pr...
My nested (ordered) dictionary looks like this: OrderedDict([ ('1', OrderedDict([('1994_fte_count', '4'), ('1995_fte_count', '2'), ('1996_fte_count', '5'), ('1997_fte_count', '7')])), ('2', OrderedDict([('1994_fte_count', '5'), ('1995_fte_count', '22'), ('1996_fte_count', '6'), ('1997_fte_count', '3')])), (...
I'd like to write classes which are Pythonic, readable and easy-usable. A main issue for me is to keep data consistency. Here is an example (version 1): from collections import namedtuple import math Point = namedtuple('Point', ['x', 'y']) class PointsAlongCircle(object): '''Set of regularly spaced points along ...
Entity Framework (version 6) generates classes based on your tables that look like this (where each property represents a field in the table): using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; [Table("dbo.MyTable")] public partial class MyTable { [Key] [DatabaseGe...
I'm preparing a new tool for our deployment system. One part of it is to generate a set of XML-files for modules. The tool is really big, so I'll post only one function here for your consideration. Prerequisites We have a template for new XML files, which looks like this: <plugin assemblyUrl="%DATAURLPREFIX%/%MOD_DLL%...
I am preparing for interviews where my code would be judged based on optimizations, OOP concepts, code readability as well as my knowledge of JAVA and design patterns. What comments will you give in code review for the below code? This is my code for Kth Largest element in an Array. The logic is to create a K size max...
A couple of questions: Is the algorithm wasting CPU time or memory unnecessarily? If there is something in the code that is not idiomatic Python, how to improve on that? def permute_first( c ): retval = [] retval.append( c.upper() ) retval.append( c.lower() ) return retval def permute( str ): le...
Any thoughts on improving this method of finding the next 8 Mondays not including today? var app = angular.module("angularApp", []); app.controller("appController", function($scope, $filter) { $scope.mondays = []; var MILLISECONDS_IN_A_DAY = 1000 * 60 * 60 * 24, now = new Date(), nowTime = now.getTime(),...
Okay I have the following use case: Module A broadcasts an event. Module B listens to that event. Maybe also Module C listens to that event. Now Module B has to perform an asynchronous operation before Module A may proceed with its code. I solved this by creating an custom module $deferredEvents which allows to queue u...
The company I am with has a lot of old code migrated over from ALPHA Basic, written back in the 1980s. As development languages have evolved (should I say, "died off"?) the code has been migrated to newer languages. The company also hires a lot of new graduates from a local college. Sometimes, the code is written in a ...
Okay, I am wanting to expand my armoury within PHP, so I've been researching OO PHP. With my researched knowledge I went on to create a quick script that reads a CSV file and outputs the results. CSV Class: class CSV { private $file; public function __construct($filename, $mode) { $this->file = fopen...
A few weeks ago, I wrote a Python implementation of 2048. Since then, I've been working on a simple AI to play the game for me. The code uses expectimax search to evaluate each move, and chooses the move that maximizes the search as the next move to execute. Similar to what others have suggested, the evaluation functi...
I am using Python with libtcodpy to build a turn-based strategy game. In this game each unit has a maximum range which varies from 4-10. This range determines how many "steps" the unit can take and therefore the distance it can move on the game map. I wish to output all the squares which the unit can move to, based upo...
The below macro finds and pastes images into column A. While the macro works, it starts to slow down when running 500+ images. I am not too familiar with the VBA language, does anyone have any suggestions to make this code quicker and/or more elegant? My existing Macro is as follows: Sub Picture() 'This Sub Looks f...