instruction
stringlengths
71
95.1k
So I came across this question on SO and I felt like it would be a cool thing to try and write a parser for since I always wanted to try it. So I present to you: My first time writing a parser. It converts strings like this: "a,s,[c,f],[f,t], [[a,c],[d3,32]]" into list objects ['a', 's', ['c', 'f'], ['f', 't'], [['a',...
I am fairly inexperienced when it comes to jQuery/JavaScript, so although the following code works, I am just looking to understand if my use of looping, deferred/promises etc could be optimised at all. Purpose of code This is just part of a larger script, which I have written to load images and its written details int...
I needed to dynamically load and instantiate some classes from a generated jar and a generated .class file which depends on that jar. So I came up with this: package ytm.yajco.translation.util; import org.jetbrains.annotations.NotNull; import java.net.MalformedURLException; import java.net.URL; import java.net.URLCla...
Unity scripts need access to components they will be using, my solution here guarantees that a script will have a valid reference to a component it needs, but is this solution overkill, or hard to discern intention from? Note: null coalescence operators would be cleaner but cannot be used for unity objects or component...
Now that my new compiler is capable of compiling programs such as the Analog Clock in AEC, I've decided to share the code of that compiler with you, to see what you think about it. File compiler.cpp: #include "TreeNode.cpp" #include "bitManipulations.cpp" AssemblyCode convertToInteger32(const TreeNode node, ...
below vbscript code took me 3hours just to complete trimming whitespaces of a 24MB file any tips to speed up the process below? dim filename, path \'variables Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(Wscript.ScriptFullName) strFolder = objFSO.GetParentFolder...
Here is my code for a move generator function for a chess engine. It's currently working perfectly and returning fully legal moves. How can i improve it. I am looking to improve this generator function and make it more efficient Any help is appreciated! #include <iostream> #include <vector> using std::cout; using std:...
The goal here is to pull all alerts from a single iterable: obj = Alerts(db, args) for alert in obj.alerts() pass Now, I need to add a few more sources and I'm not sure if this is a good approach to instantiate all classes in the AllAlerts constructor? I also don't like the fact that I'll have to add them to the s...
I need help in rewriting my code to be less repetitive. I am used to coding procedural and not object-oriented. My scala program is for Databricks. how would you combine cmd 3 and 5 together? Does this involve using polymorphism? My notebook first import parquet staging files in parallel. Then it run notebooks in paral...
I made a chatroom with a server and client python files, using Sockets and Threading as a project. I'm interested to acquire advice, and optimizations i could make to my program. Also please give me tips on sockets and threading in general, because I'm fairly new to the topic, and i would want to learn whatever is rele...
I created a solution for the car pooling algorithm. Problem: You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around and drive west.) Given a list of trips, trip[i] = [num_passengers, start_location, end_location] contains info...
Heres a code that update weekly datas from production reports Known flaws : Im copy pasting the old line and replacing the week number in it to fit it to the one we want to update. The problem is that its not taking in account if cell emplacement of the data is changing. I also tought it was simpler than re-writing al...
I am trying to create three buckets of objects. Today, yesterday and past. I am wondering can the following be done in a more concise way in pure JavaScript without any libraries? const [todayBucket, yesterdayBucket] = [0, 1].map(offset => recordings.filter(({ createdOn }) => moment(createdOn).isSame(moment().add...
I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem Design a Skiplist without using any built-in libraries. A Skiplist is a data structure that takes O(log(n)) time to add, erase and search. Comparing with treap and red-black tree which has the same funct...
It took me a while to solve this question and there are corner cases i missed hence the 4 unit tests. please review for performance. and if you can treat this as a review for a 45 mins programming interview. https://leetcode.com/problems/find-and-replace-in-string/ To some string S, we will perform some replacement op...
I wanted to know how "dark" each character is when printed. I thought that this may be useful when doing ASCII-art to help with shading. I decided to write a program to objectively measure how much coverage of an area each character provides, which should roughly translate to how dark it appears when printed and zoomed...
I built a simple infinite scroll using the intersection observer API, would love some feedback on ways to improve my JavaScript and make it more maintainable and reusable, and feedback according to best JavaScript practices. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Infinite Scro...
For my hashmap implementation, I'm caching hashes for each map element in an array of length NBUCKETS, where each element corresponds to an element in the hashmap. Assuming a hash consists of 64-bits, the first 57 bits decide the position(bucket) in the hashmap and the last 7 bits (i.e H2(hash)) are used as control byt...
Please review and help me write better codes. Combining Pictures We can use a conditional to copy just the non-white pixels from one picture to another picture. We can take this tiny image of the women and put her by the Eiffel tower in Paris, France. I have modified the code so that the code automatically swaps the im...
I thought it would be fun to write a simple and small bash script which randomly chooses a wallpaper from a given directory of a set of wallpaper images. The code is as follows. #!/bin/bash # simple script to choose random image from # Wallpaper directory and set it as desktop background # cd into Wallpaper dir cd /...
I'm currently using a function to check if a URL has correctly escaped two different characters: . and /. To escape a character within a string, it requires 2 preceding \'s in the string (i.e.: \\. or \\/). Here is the code I'm currently using. As you can see I'm matching the string with some regex, and then for every ...
The code works fine for inputs that have a solution. The goal board is 1 2 3 4 5 6 7 8 I have tried to implement using the A* search algorithm. The code runs for 2 seconds or slightly more time which seems slow compared to the implementation in other languages. How do I optimize the code? I have included two sample inp...
I'm building a method that tries to detect whether given information about an object's property to retrieve, a constraint operator and some data to compare it against, whether the result is true or false. So I'm given is an object containing the type of object to read (File, Folder, RegistryKey, RegistryValue, MSI), th...
This is my version of the Snake Game. The project is not done yet, I still want to try to implement some other game mechanics like two player mode, high score leaderboard, etc. Also I would like to implement GUI if it won't be to hard. At this point the game is already playable, that means that the basic game mechanics...
I saw this entertaining talk by: Bob Martin on clean code and started refactoring a relatively simple class today. I am, by no means, an expert on coding and still learning a lot every day, so I want to get this right eventually as well :). The purpose of the code is to retrieve an xml document from a website, which co...
Below I have enum representing State of a UITableView. The states are divided into 3 categories as below. For all the 3 states I have different UITableViewCells which will be shown for respected cases. So for fetchMovies input, I am actually checking the movies count and emitting the state & once again after the result...
I finished a sorting algorithm visualizer (for now only uses bubble sort) and this is the code. I'd like some suggestions to improve the memory usage or time elapsed. Built with Cmake and Ninja on Windows Demonstration main.cpp #include "Engine.h" #undef main int main() { try { // if the amount is hig...
I am working with a dataframe of over 21M rows. df.head() +---+-----------+-------+--------------+-----------+----------------+------------+ | | id | speed | acceleration | jerk | bearing_change | travelmode | +---+-----------+-------+--------------+-----------+----------------+------------+ | 0 | 5338150...
I've implemented an A* with a priority queue. I am not getting any performance issues in this little game that I am making but it would be interesting to know how to improve this. I am doing a few o(n) searches in getNode & isSuccessorValid. I thought about using an unordered map and pointing to each node location but ...
I'm trying to build a React Boilerplate Using multiple tools. They are all: React, TypeScript, ESLint, Webpack, Babel, Prettier, VSCode and with Airbnb's code style guide. Actually, this is my first Boilerplate. I don't know if there's a redundant dependency or unnecessary codes inside. Can you please review it? The de...
Below is an implementation heavily based on climberig's implementation on Leetcode for LeetCode 706. Design HashMap. Just to preface, I am doing this in preparation for an exam. The one below is dynamically sized, so it should increase the size of ListNode[] whenever the condition (keyCount > length * 0.90) has been me...
I have created a working VBA script that allows the user to select a workbook and make a values only copy of it without opening it. This is useful for getting data from a workbook that is very slow to open. From here: https://stackoverflow.com/questions/63398348/how-can-i-copy-the-values-only-from-an-entire-excel-workb...
I've ported the Analog Clock program written in AEC from Linux to WebAssembly. You can see the live version. /* * This is my attempt to port the Analog Clock in AEC, previously available * for Linux and DOS, to WebAssembly. */ //Let's import some functions useful for debugging from JavaScript... Function logString(...
I have a constantly growing corpus of currently ~36,000 documents (growing daily) and I want calculate the similarity between each pair of documents. After calculating the similarity scores, I want to filter the results to only include scores above 0.9, and capture the (row label, column label, metric) in a list of tu...
My angular knowledge is limited, so I don't know much yet about it's garbage collection etc to make sure my component can be used without any strange side effects or memory leaks. I've created a stackblitz with a working version of the component here: https://stackblitz.com/edit/angular-material-messagebox?file=src/app...
Could you please give me some direction about how I could refactor my code? As I add functionalities to my Budget App the class is getting bigger and I'm sure I could start looking at separating concerns and maybe using some sort of abstraction. I've been studying OOP for a few months now but I'm not sure how to apply ...
Please review my program and give some tips . I am a beginner. IT is for those people who sit on computer all day and get unhealthy . This will remind them to do eye exercise , physical exercise and to drink water import pygame import time t = time.ctime(time.time()) # noinspection SpellCheckingInspection totalbreaks2...
So I've been learning about MVVM and I had a problem. I often had to start a thread to download or do some longer task in background and when it is done change some properties so the UI updates. The problem is that the UI will update only if I changed it from the main thread. So I often had to create DispatchTimers to ...
The Django ModelAdmin offers a filter_horizontal (or filter_vertical) interface for many-to-many relations, which allows the user to filter a list of available related objects. My goal is to limit the set of choices for this interface, dynamically, based on the value of another form field. This is somewhat similar to f...
Intro If you want to know, then about 10+ years ago, I started a journey on the (best in my country) color picker for WinXP, later Win7. Since now it is hardly compatible with Win10 and HiDPI (work in progress), and in no way compilable in Linux using Lazarus, it would take quite an effort to create a decent desktop co...
I am starting up a project with some people, because there will be developed for and on multiple platforms we chose to use CMake to build our project. Because the project will get quite large we are trying to have a good setup but we lack the experience needed in CMake to make well thought out decisions. We are using ...
Below is a json schema I have in elastic search { "fullName": "", "avatar": "", "email": "", "resumeLink": "", "phone": "", "role": "", "noticePeriod": "", "dateOfBirth": "", "gender": "", "maritalStatus": "", "address": "", "location": "", "industryType": "", "pe...
I wrote my first benchmark using Google Benchmark to check what is faster between the use of std::string::length and strlen to compute the length of a std::string. I would like to know what I can improve in my code to use it as a base for future benchmarks. My main concerns are about: the creation of the std::string a...
this was my first thing i made on my own without any help. im sure theres a lot of improvement that could be made, i dont feel too confident about this. how can i make it shorter and more efficient? should this entire thing be rewritten in some other way? refactored? keep in mind if i wanted to add more birds to the li...
Any advice on how to make this code; cleaner, more effective, just overall better! Program setup object that is coming from the database EF. It then maps the object to a view model and converts datetime to string and different datetime components. //EF Data List<MeetingEvent> Meeting = new List<MeetingEvent...
Here's a simple one for u guys, The code is called upon workbook_open and BeforeSave, it displays the right sheet in function of date and time (Day vs night shift vs date). The code run trough the sheet and activate it if the date on sheet is the same as the actual date. Since there's 2 sheets with the same date (day a...
I'm experimenting in Unity with a tile-based game with crisp 32x32 tile textures and pixel perfect camera. I did not like the results coming from Unity's default Tilemap approach mainly because due to the crispiness of the textures, the edges between them (biome boundaries, if you will) were too sharp for my taste. I w...
I don't really have a problem. But, it's my first time using Kotlin for any project, so I want to know if there is any problem in my code or my code can be made cleaner. This is an arithmetic parser made in Kotlin. It can evaluate a expression like "(6+4)/(2+3)" to 2.0 This handles operations like Power(^) Divison(/) ...
I know there is a way to simplify these checkbox onClick functions. I'm just not sure how to make it happen. Upon checking the checkAllProfiles checkbox, all of the profileCheckboxes are checked: $('#checkAllProfiles').on('click', function() { $(".profileCheckbox").prop('checked', $(this).prop('checked')); }); Then...
I'm new to Go and have a use-case for periodically executing an async work-function. I want the interval between work-function executions to be constant (not the time between one finishing and the next starting). I also want this work-function to be executed some number of times. This translates to "run work N times...
To practice the very basics of node back-end, I'm implementing the most basic server possible for static content, using only the core node modules: http fs path With the following server requirements: Can serve any http file inside the public directory. Accepts only GET requests, 404 for anything else. Accepts only ...
I need some feedback, please. Goals to practice: templates, std, interfaces, return value, constructors and some idioms. People often suggest to use a library, but it's not the goal of this exercise, so please don't suggest those. My worries about this code correctness of returns by value\reference correctness of iter...
Problem I'm trying to create the most performant code to: Extract a text file from a zip parse its content serialize class post to Azure Queue Storage Scenario 4 times per year I receive 20 zip files. All zip files have just one text file inside. Each text file is a fixed width file. Each line in the text file is a d...
The exercise is as follows: Player A will write list \$ a \$ consisting of \$ n \$ numbers. Player B will take a look at the paper. After that the A player will ask player B \$q\$ questions. Each question will be of the following form: If I give you two \$ R \$ and \$ L \$ in \$ a \$ such that (\$ 1<=L<=R<=n\$ ), calc...
Source I made a project for a class, a MIDI editor written with Java 8 and Swing, and continued working on it on my own. However, I ran into a problem I couldn't solve and gave up. I'd like feedback on high level design/architecture, things like cohesion, coupling etc between classes. I'm pretty sure the project is wea...
We are given an array of intervals we need to merge all overlapping intervals and sort the resulting non-overlapping intervals. When they "touch" in a single point, intervals are also considered to be overlapping . class Span { public uint Start { get; } public uint End { get; } private Span(uint start, ui...
I'm working on a text-based tic-tac-toe game, mostly for fun and because I'm learning programming. I would appreciate any comments you could give me to improve it. Main structure: Uses a Board class for all the game. It's initialized with an empty tic-tac-toe board implemented using numpy arrays. It has views to handle...
This is a practice task from Automate the Boring Stuff with Python. I imagine many others have asked for their version of the solution to be checked, so I apologise beforehand for boring you yet again. In brief, the task entails writing a code that carries out an experiment of checking if there is a streak of 6 'heads...
I have written a code that triggers my div with another menu. I do not know which one is better and should be used. Can I get some feedback? First code in one function: function sidebar() { var menu = document.querySelector('#sidebar-container'); var menuSmall = document.querySelector('#sidebar-container2'); ...
I'm writing a method that writes the code for a loading routine. Given an object from the database, I want to put its properties in the right control on a userform. I have the list of the properties and I have the names of the controls. For each property, I want my code to search in the controls' name and find the most...
I've got a working solution to the Rustlings from_into exercise (i.e. the code compiles and all the tests pass). The task required that I implemented the From trait for struct Person. I've highlighted the relevant section inline with comments below. // The From trait is used for value-to-value conversions. // If From i...
Generally, the approach I've taken is to try calling container.decode from a decodable enum with its associated value returning the actual class. Each time the call to container.decode throws a different class is tried, from the class with the bigger number of member vars to the one with the smaller number of member va...
I am currently going through this Vulkan tutorial. An extra excercise was writing a function which checks if the hardware you are running on supports the extensions other libraries require (GLFW in this case). All the code is here: #define GLFW_INCLUDE_VULKAN #include <GLFW/glfw3.h> #include <iostream> #include <stdex...
I am writing wrapper classes in Java which override methods of an existing implementation, in order to handle an edge case. The full implementation is a bit more complex than needs to be posted here, so I've written a simplified class containing only the parts I'm requesting assistance on. Problem Summary I am extendi...
BACKGROUND I have a function where i cache file from aws s3. I provide it the path on s3 and also the local path of where i want the cached file to live. Sometimes if the file does not exist on s3 it will return a 404 error. That makes sense but i want to handle it gracefully. What i want to do is if the file i am tryi...
Original post: Sorting algorithm visualizer in C++ and SDL2 I followed the advice you gave me and improved my code. I also added two more sorting algorithms. I'm mainly looking for code readability advice (Built on Windows with cmake and ninja) Demonstration props to @Zeta for the demonstration main.cpp #include "Eng...
In c there is the macro assert and while it works I don't picturality like it mainly because it has no good way for printing a string. As a result I attempted to create a better version of assert for c++. However, I over engineered it leaving me with something that slows compile times, and something that I would not us...
I am trying to transfer my c ++ experience to the Go area. I'm new to Go, so not sure if the implementation is correct. In any case, it looks very ugly compared to C ++ code. Is there a nicer solution? Both solutions are executable in playground and give same result. c++ playground: https://code.sololearn.com/c67xbW2AE...
Kotlin 1.3.+ RxJava 3.0.+ Kotest 4.1.+ // SingleValueCache.kt package com.example import io.reactivex.rxjava3.core.Single import java.util.concurrent.Semaphore import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference abstract class SingleValueCache<V> { protected abstr...
This is a project that finds a specific anime (show) and checks to see if there is a new episode of it . this is also the first time that i used def like this and wanted to ask how this project looks and how i could improve it ? from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from...
Instead of the obvious decision, parsing using given std::io::Lines/std::io::Bytes or crates like nom, I decided to explore writing my own specialized scanner that operates on std::io::BufRead. I have two (self inflicted) problems. Firstly, scanner must operate on bytes, utf8 validation given by rust String would reall...
I wrote a discord bot that listens for links to the d20pfsrd rulebook in discord chat, checks if they are feats or magic, and then scrapes the page, formats it, and spits it back into chat as formatted text. The pages I'm checking are formulaic enough, so even though the cheerio selectors I'm using are probably fairly ...
A few days back I found an interesting problem which reads the following: Given two vector spaces generate the resulting set of its cartesian product. \begin{gather} \text{Let: } \mathcal{V}, \mathcal{W} \text{ be vector spaces}\\ \mathcal{V} \times \mathcal{W} = \{ (v,w) \mid v \in \mathcal{V} \land w \in \mathcal{W} ...
I made a tic tac toe bot with the following rules (it's not unbeatable): If bot is about to win, it will find the winning move. If bot is about to lose, it will find a move that prevents the other player from winning. if none of rule 1 or 2 is found, then it will play a random move I think it's highly inefficient, so...
I am trying to write a Person class in Ruby which has some methods and properties. The below is how I have implemented it now. class Person attr_accessor :name, :gender, :mother, :spouse def initialize(name, gender, mother = nil) @name = name @gender = gender @mother = mother @spouse = nil end ...
I have a chunk of code here: public class ParserFactory { public static ParserClass getParserClass(InputStream is, CustomMap customMap, DataHandler recordHandler, DataHandler columnHandler) throws JsonProcessingException { ParserClassType ParserClassType = Pars...
So I answered this question on SO and probably did someone's homework along the way. In the original question the OP has the answer variable and wants it split to real and imaginary values with the original coefficient (q in the original post) as an array for each q from 1 to 10, so you get an array of arrays looking l...
This is regarding leetcode Question# 123. I have solved the question (code below) but the solution is showing "Your runtime beats 5.89 % of cpp submissions."? Is there any additional optimization I can do to make it run faster? class Solution { int maxProfitUtility(vector<int>& prices, int i, int buyOrSell, int k, ...
I am a beginner in Python and I have written a program to convert binary numbers to decimal. It works, but are there any ways to improve the code and make it better? def binary_to_decimal_converter(binary_value): print(f"Binary: {binary_value}") decimal_value = 0 # Treating binary input as a string # po...
I've created an email sender with providers for the email content, that will be changed based on the email type. I need some help to enhance it. These two models are used to send public class EmailAddress { public string Name { get; set; } public string Address { get; set; } } public class EmailMessage { p...
My objective is to find out on what other subreddit users from r/(subreddit) are posting on; you can see my code below. It works pretty well, but I am curious to know if I could improve it by: First, restricting my code so that it only considers users only once (i.e. not collect the posting history twice for the same u...
How can StringEnumeration be changed in the code below into a generic class, so that ConsensusState wouldn't need the JsonConverter attribute to enable instances of the class to be used as if they were serializable enums with associated string values? I'm using StringEnumeration to allow checking instances of Consensus...
I am trying to solve the following Codewars kata. We are given a list as seq = [0, 1, 2, 2] We will have to write a function that will, firstly, add elements in the list using the following logic. if n = 3 and as seq[n]=2, the new list will be seq = [0, 1, 2, 2, 3, 3] if n = 4 and as seq[n]=3, the new list will be seq ...
This is in a node and express API. I'm trying to figure out the best way to handle Promises that resolve, but return a 404 response. I have a method which uses node-fetch to make a POST call to update a row in a database. If an invalid profileId is provided, the Promise will resolve even though the response is a 404. I...
I'm learning really basic java at school but I learn on my own at home. I've had some experience with simple swing games, but this one exceeds all. I want any opinion and advice someone may contribute. public class Display { private JFrame frame; private Canvas canvas; private String title; private in...
I've written some F# code to handle commands in the context of event sourcing which works along the lines below: Read Events from a specific event store stream Build the current state in the given business / domain context accordingly to the events that has just been read right above Decide new events based on the cur...
Problem statement : Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W. If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows, return the one with the left-most starting index. Ex...
I made a scraper for Steam that get different info about a Steam game, such as the price, the specs and the supported platforms. The reason I made this was because I have a super slow laptop, so looking at many games would take a long time :) Some things I would like to improve is have better error handling, as the web...
While I have never had to swap two files I have always wondered if there was command for swapping two files and recently I decided to see if there was one. Eventually I found out that there wasn't one and as a result I decided to create one. Here is the code: main.cc #include <iostream> #include <filesystem> #include <...
I have a working logon for a WinForms Project. I use the program.cs file to launch the login form. I am not so sure there isn't a better way of implementing this. Here is my program.cs file: using System; using System.Windows.Forms; using WindowsFormsApp.Presenters; using WindowsFormsApp.Views; usin...
I'm new to using python and wanted to know how I could improve my program. I'm using the Luhn algorithm, the beginning numbers of the credit cards, and the number of digits in the credit card. from cs50 import get_string import re import sys number = get_string("NUMBER: ") check = [] if (len(number)) not in (13,15,16...
I'm an experienced python 3 programmer but I've recently started focusing more on JS to make client side applications for my website. So I'm not too familiar with advanced level techniques, best practices, etc in JavaScript. I'll post all the code here (HTML/CSS/JS) so you can run it, although the primary thing I'd lik...
I have been reading today about the Abstract Factory Pattern, and tried to make the following implementation. I have seen a lot of implementations in the internet, where they use switch statements, but I must say that I didn't like that much, since the more factories you make, it seems to me that it makes very difficul...
I wrote a library that implements LZW compression and decompression. A goal of this project was to help me acquaint myself with modern C++ development practices (I primarily come from a Java background and have a smattering of C experience). I want to use this library to compress data and stream it over TCP sockets to ...
I'm implementing the logic of a board game in Java to practice my coding skills. I chose Food Chain Magnate because is a fairly complex game that requires different data structures. One of my first tasks is to generate the data structure for the game board. In the game, the board is built using some (of all, depending ...
This project was highly inspired by the popular drawille project, that lets one draw to the terminal using the braille unicode characters. The advantage of drawing with braille characters compared to normal ASCII characters is simple: Because every "braille-character" is made up of 2 x 4 = 8 possible spots, we have 256...
Here is my revised code from my other review question Node JS delete multiple MySQL linked records and delete physical file Just would like to hear some reviews if I have the right logic. router.delete('/:id', (req, res)=>{ function deleteCommentRecords(){ db.beginTransaction(function(err) { if(err) retur...
I am new to async methods and am kinda confused how async is working so what i want for you to do is review this code and tell me does implementing async like this is meaningless [Route("/Dev/ForceBufferUpdate")] public async Task<IActionResult> BufferUpdate() { bool isAdministrator = await Task.Run(() => { ...
I am creating a social network that let's users upload a profile picture. I just want to know if this is a secure way of doing it. Thanks. <?php include 'includes/header.php'; include 'includes/form_handlers/settings_handler.php'; //$userPic = ''; $date_time = date('Y-m-d_H-i-s'); if(!empty($userLoggedIn)) { i...
I adding some pathfinding to a game I'm working on. It primarily used A* with as suggested in the pathfinding articles at reb blob games. It works, but isn't very fast. It is a square grid map that (at the moment) has uniform movement cost, but in the future I will to add weights that make paths avoid enemy units etc. ...