This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymunk | |
from manim import * | |
import random | |
# transform the pymunk position to manim position | |
def transform_pymunk_to_manim_position(p): | |
return p[0] / 100.0, p[1] / 100.0, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shortestPathSearch(game_board, y_npc, x_npc, yp, xp) { | |
const numRows = game_board.length; | |
const numCols = game_board[0].length; | |
// Define movement directions (up, down, left, right) | |
const dx = [-1, 1, 0, 0]; | |
const dy = [0, 0, -1, 1]; | |
// Create a 2D array to mark visited cells and store parent cells | |
const visited = Array(numRows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <array> | |
#include <algorithm> | |
#include <chrono> | |
#include <iostream> | |
#include <string> | |
//constexpr int N = 128; | |
constexpr int SIZE = 1024 * 150; | |
constexpr int REPEAT = 1024 * 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////// | |
// | |
// Task : merging two vectors of SortRecords into one vector | |
// Author: R.Baca | |
// | |
///////////////////////////////////////////////////////// | |
#include <vector> | |
#include <algorithm> | |
#include <random> |