import java.util.ArrayList;
* @param sourceLocNo : The node from which the edge comes.
_____ _ _ _
import TicketForm from './TicketForm'; * @version 1.0
* @param destLocNo : The node to which the edge goes.
}
Learn how to configure a non-root public URL by running `npm run build`. public MathException(String message) {
private String message;
*/
}
"publisher": "jirin", * @see {@link DijkstraAlgorithm.java}
#........G.....G.........# ___ _ _ _
<!-- * Creates all the edges (connections between nodes) of the network anew
/**
List<Integer> edgeIDs = getEdgeIDsAroundPoint(coordinates);
.signup-form label { for (int i = 0; i < edgeIDs.size(); ++i) {
}); "@typescript-eslint/parser": "^5.17.0", protected static int[] nodeIDToMapCoordinates(int nodeID) {
*/
* @param Coordinates of the tile to calculate the path towards.
/ _ \ (_)| |(_)
|_|
"test": "yarn run compile && node ./node_modules/vscode/bin/test" protected void addEdge(String edgeID, int sourceLocNo, int destLocNo) {
onCancel={this.props.handleTicketAdded}| | \/ ___ | |_ _ __ __ _ | |_ | |__
*/
else {
|_|
<div id={"tag-name"}>{props.profile.name}, {props.profile.age}</div> // Creates the 25 nodes of the network
protected LinkedList<Vertex> getShortestPath(int[] mapCoordinates) {
}
render() { /**
protected List<Integer> addEdgesToList(Integer coordinate1, Integer coordinate2, int offset) {
}, \____/ \___| \__| | .__/ \__,_| \__||_| |_|
}, this.props.eventId, this.props.loadTickets); // The nodes of the network
<div id="root"></div>
* to land at the edge number at the right (/ top) of the point [1,2] (/ [2,1])
addEdge("Edge_" + edgeIDNumber, i + j, i + j + 5);
* @release 15/12/2017
}
"@types/mocha": "^2.2.42", /* Please look at the ordering as described above to understand the maths here:
"version": "1.2.9", private List<Edge> edges;
onSubmit = (e) => {export default connect(null, {addTicket})(TicketAddContainer); protected List<Integer> getEdgeIDsAroundPoint (Integer[] coordinates) {
}, </div>} protected static int mapCoordinatesToNodeID(int[] coordinates) {
public MathException() {}
dijkstra.execute(nodes.get(mapCoordinatesToNodeID(mapCoordinates)));
manifest.json provides metadata used when your web app is added to the} protected static int vertexToNodeID(Vertex node) {
/*
\___/ | .__/ \__,_| \__,_| \__|\___| \_/\_/ \__,_||_||_||___/
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
List<Integer> edgeIDList = new ArrayList<Integer>();
price: '', | | _ __ _ | |_ _ __ _ | | _ ___ __ _ | |_ _ ___ _ __
* The math:
for (int j = 0; j < 20; j += 5) {
}
startI = 0;
</head> * @param The coordinates of the obstacle to add.
-->} --> */
for (int i = 0; i < 5; i++) {
| |
* it is this easy because of the order in which the edges where constructed.
*/
import * as React from 'react' /**
}
| _ || | | |\ \/ /| || || | / _` || '__|| | | |
"categories": [ if (coordinate2 == 0) {
// Creates all vertical edges
* @param edgeID : The "name" for the new edge.
Edge newEdge = new Edge(edgeID, nodes.get(sourceLocNo), nodes.get(destLocNo), 1);
* @param coordinate1 : The first coordinate (either horizontal or vertical).
* <p>
state = { return (int) Integer.parseInt(node.getId());
}
endI = startI + 4;
int[] coordinates = new int[] {nodeID / 5, nodeID % 5};
* @return List of the horizontal/vertical edges adjacent to the tile.
\_| |_/ \__,_|/_/\_\|_||_||_| \__,_||_| \__, |
* Gets the ID values of the edges around a node in the network.
|_ _| (_)| | (_) | |(_) | | (_)
</html> work correctly both with client-side routing and a non-root public URL. */
}
// The graph containing the nodes and the edges linking them
To begin the development, run `npm start` or `yarn start`. */
"vscode:prepublish": "yarn run compile", ] nodes.add(location);
| |
* Adds an 'obstacle' in the network by setting the weights of all the edges around it to a high value.
*/
*
return coordinates[0] * 5 + coordinates[1];
<head> dijkstra = new DijkstraAlgorithm(graph);
* @return The corresponding Node ID.
values={this.state} />);/**
* @param List of the coordinates of all the wall tiles in the 5x5 grid. Called from {@link Bot}
import {connect} from 'react-redux'; [e.target.name]: e.target.value#.....###........###.....#import React from 'react'; }
* <p>
export default function ProfilePicture(props) {public class MathException extends Exception {
edgeIDList.addAll(addEdgesToList(coordinates[0], coordinates[1], 0));
// Creates all horizontal edges
} <meta name="theme-color" content="#000000" />
an Edge is always created between two node ID numbers and there are 5 nodes in a row */
// Add the vertical edges to the list
resetEdges();
private DijkstraAlgorithm dijkstra;
"Other" The build step will place the bundled scripts into the <body> tag.
for (int j = 0; j < 4; ++j) {
/**
edgeIDNumber ++;
<title>侍鈴々原作</title>} <meta charset="utf-8" /> }
* IDs 40-79: vertical edges (and e.g. 40-47 for the leftmost column)
########################## }
<html lang="en"> <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" /> *
/ /_\ \ _ _ __ __ _ | | _ __ _ _ __ _ _
| | | | | | | | | || |
super(message);
pictureUrl: '' "command": "extension.toggleSemicolons", int edgeIDNumber = 0;
*
for (int i = 0; i < 25; i++) {
initialiseDijkstra();
/**
*
* IDs 0-39: horizontal edges (and e.g. 0-7 for the top row)
// The class that computes it all using a graph
nodes = new ArrayList<Vertex>();
edgeIDNumber ++;
* @return A list of the vertices (nodes) to the target tile, starting at the source tile.
return coordinates;
* (e.g. the point[3,1] gives edge 13, while edge 12 and 13 surround it).
* @see {@link Bot.java}
return ( */
// All the edges in the network
</div> }
* Gives the edges that lie around a point in either horizontal or vertical direction.
protected void updateNetwork(List<Integer[]> wallList) {
this.props.handleTicketAdded();#..........###...........#
"commands": [ }
#........................# ],class TicketAddContainer extends React.Component { /> "typescript": "^4.6.0",
"onCommand:extension.toggleSemicolons" // (Remember, there are 5 nodes in each row)
<img id={"cover-photo"} src={props.profile.pictureURL} alt={props.profile.name}/> return (<TicketForm onSubmit={this.onSubmit} */
} else {
// Makes the ID of the vertices just a number for easy conversion
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/ <noscript>You need to enable JavaScript to run this app.</noscript> }, }
This HTML file is a template.
</div>
Notice the use of %PUBLIC_URL% in the tags above. "eslint": "^8.12.0", * so that all have the same weight.
*/
return halfEdgeIDList;
private List<Vertex> nodes;
########################## }
| | | '_ \ | || __|| | / _` || || |/ __| / _` || __|| | / _ \ | '_ \
}| | | | _ __ __| | __ _ | |_ ___ __ __ __ _ | || | ___
* @return The corresponding set of coordinates.
}
* @return A list of the ID values of the wanted edges.
*
*/
protected void initialiseDijkstra() {
* Add and edge with weight 1 to the network.
public class DijkstraOperations {
| | | || '_ \ / _` | / _` || __|/ _ \ \ \ /\ / // _` || || |/ __|
* The same logic has been used, except all times 2.
"engines": { } return dijkstra.getPath(nodes.get(mapCoordinatesToNodeID(mapCoordinates)));
"compile": "tsc -p ./", graph = new Graph(nodes, edges);
*/
"vscode": "^1.32.0"
* Creates the network anew in order to stay up-to-date on where the walls (i.e. obstacles) are.
|___/
edgeIDNumber ++;
_____ _ _ _ _ _ _ _
}
* So then, you want to get the edges around it, you take this number -1 and the number itself.
#........................# * and avoid walls in the process.
* @param offset : The edge ID number at which to start 'counting'.
endI = startI + 2;
* @param Node ID to convert.
* The edges are ordered like this:
#......G..........G......# */
"title": "Toggle Semicolons" /**
*/
/*
/*
name Small Labyrinth of Doom Vertex location = new Vertex("" + i, "Node_" + i);
<!DOCTYPE html> * Creates all the things necessary to run Dijkstra's algorithm.
onChange={this.onChange} List<Integer> halfEdgeIDList = new ArrayList<Integer>();
}
}
/**
"name": "semicolon-spammer",| | | || |_| | > < | || || || (_| || | | |_| |
* @param coordinate2 : The second coordinate (either vertical or horizontal).
/* Edges are created back and forth because Dijkstra's algorithm uses
<!-- * Default constructor.
addEdge("Edge_" + edgeIDNumber, i + j + 1, i + j);
</body> _| |_| | | || || |_ | || (_| || || |\__ \| (_| || |_ | || (_) || | | |
| | __ / _ \| __| | '_ \ / _` || __|| '_ \
for (int i = 0; i < wallList.size(); ++i) {
You can add webfonts, meta tags, or analytics to this file. int endI;
* that was used when running executeDijkstra(). Run from {@link GameLogic}.
* in order to move towards the human player efficiently
/**
halfEdgeIDList.add(offset + coordinate1 * 8 + coordinate2 * 2 + i);
} Edge edgeToRemove = edges.get(edgeIDs.get(i));
_ _ _ _ _ _
* @param Node (vertex) to get the ID number from.
} }
* https://github.com/vogellacompany/codeexamples-java/blob/master/de.vogella.algorithms.dijkstra/src/de/vogella/algorithms/dijkstra/test/TestDijkstraAlgorithm.java
"watch": "tsc -watch -p ./", \___/|_| |_||_| \__||_| \__,_||_||_||___/ \__,_| \__||_| \___/ |_| |_|
...this.state, edges.set(edgeIDs.get(i), edgeToRemove);
import {addTicket} from '../../actions/tickets'; */
resetEdges();
* For the vertical values, the coordinates are swapped and the offset is increased to 40:
__/ |
int startI;
/**
onChange = (e) => { protected void addObstacle(Integer[] coordinates) {
<meta display: block;win 3 // Add the horizontal edges to the list
}
protected void executeDijkstra(int[] mapCoordinates) {
graph = new Graph(nodes, edges);
return edgeIDList;
{ "@types/node": "^8.10.25",| |_\ \| __/| |_ | |_) || (_| || |_ | | | |
}
It will be replaced with the URL of the `public` folder during the build. "displayName": ";;;;;;;;",*/
* @see {@link Graph.java}
* @param Coordinates of the point around which to take the edges.
description: '', <div id={"cover"}>#...........E............#import java.util.List;
| |_| || |_) || (_| || (_| || |_| __/ \ V V /| (_| || || |\__ \
*
}
"description": "Gives access to a command that adds/removes semicolons at the end of the current line or of all currently selected lines;",
name="viewport" If you open it directly in the browser, you will see an empty page.
addEdge("Edge_" + edgeIDNumber, i + j + 5, i + j);
}
) * @param Coordinates to convert.
* @param Coordinates of the tile from which to run Dijkstra.
edgeToRemove.setWeight(99999);
/**
<div> "@typescript-eslint/eslint-plugin": "^5.17.0",
price: +this.state.price, for (int i = startI; i < endI; ++i) {
* @see {@link Edge.java}
Only files inside the `public` folder can be referenced from the HTML. * to create a network for the 5x5 grid in the Bot's memory
addObstacle(wallList.get(i));
"main": "./out/extension", * Get the most efficient path to a specified tile from the source tile
*/
<!--
], * @author Jiri Swen
}
"scripts": { a directional graph and I want all connections to be bi-directional */
"devDependencies": {
/**
e.preventDefault(); * @see {@link Vertex.java}
"activationEvents": [ "dependencies": {} this.props.addTicket({ <body>{ "vscode-test": "^1.6.1" * And of course, if it is at an edge of the network, the left/right side would need to be excluded.
private Graph graph;
* If you think of the network as having 20 edges, you can do coordinate1 * 4 + coordinate2
addEdge("Edge_" + edgeIDNumber, i + j, i + j + 1);
public DijkstraOperations() {
#........................# /**
edges.add(newEdge);
edgeIDList.addAll(addEdgesToList(coordinates[1], coordinates[0], 40));
--> "@types/vscode": "^1.66.0", Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will } this.setState({ "contributes": {
for (int i = 0; i < 25; i += 5) {
/*
System.err.println(message);
protected void resetEdges() {
* Run Dijkstra's algorithm (from {@link GameLogic}) based from a specified source tile.
| __ \ | | | | | |
edgeIDNumber ++;
/**
import java.util.LinkedList;
#......G.........G.......# * Makes use of some classes I found that implement Dijkstra's pathfinding algorithm
startI = -2;
}
<div id={"cover-tag"}> pictureUrl: this.state.pictureUrl || null edges = new ArrayList<Edge>();
if (coordinate2 == 0 || coordinate2 == 4) {
"repository": "https://github.com/Shirijii/semicolon-spammer", dijkstra = new DijkstraAlgorithm(graph);
* @return The corresponding ID number.
To create a production bundle, use `npm run build` or `yarn build`. * Got this method from vogella:
<div id={"tag-location"}>{props.profile.location}</div>
content="width=device-width, initial-scale=1, shrink-to-fit=no" },


ABOUT























osu! db manipulator