GithubHelp home page GithubHelp logo

insyri / bhop-bot-ts Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 3.0 274 KB

๐Ÿ” Rewrite of drumman22's Bhop Bot for the Roblox Bhop / Surf Discord in TypeScript, including legacy functions.

License: MIT License

TypeScript 99.86% Shell 0.14%
typescript rewrite detritus nodejs discord-bot discord

bhop-bot-ts's Introduction

๐Ÿ‘‹ Hey, I'm insyri, a highschool student who does software engineering as a hobby.

I started programming seriously in 2021-2022, creating developer tools and small projects. From then, I've evolved to become more intentive and careful with the way I create programs, investigating optimizations heavily within my study.

I'm currently studying Linear Algebra (leading into computer graphics), models of computation, the history and philosophy of mathematics and efficient memory management practices for system-critical programs. I apply these bits of knowledge into some projects of mine, but eventually, I plan to create programs specific to these topics to prove my own mastery to myself.

I'm currently the president of computer science club at my school, providing an introduction to programming architecture and software tooling by developing mini-programs (like Michele Pratusevich's Terminus) and encouraging students to go out and make something they've always wanted to makeโ€” you wanna make a game on Roblox? Go for it, I'll help you find resources.

Before the summer, I showed just how approachable computer science is with the right mindset; from building a simple snow program (with written assessments and proposals of the code!) to hosting an (incomplete) course on learning software development. Over the summer, I'm teaching students the Kotlin programming language. When we come back, we'll be building an app to save students from missing their buses at school.

๐ŸŒŒ software socials

๐Ÿ–ฅ development information

๐Ÿ— projects

rsource is a project aimed to create services around the Roblox StrafesNET ecosystem, including map development support, game unifying creations, and constructing transcendent experiences. View the full introductory showcase at the rsource github organization and at the rsource website.

Note

This project has been postponed and temporarily discontuned as the StrafesNET API, the services that this project is built on, has been out of commision for a long time, and has no anticipated reinstitution date.

A strongly typed Pylon API client. https://pylon.bot/

CI

๐Ÿ“‚ Server for pasting, uploading, and downloading files.


๐Ÿซ learning soon

bhop-bot-ts's People

Contributors

coolestdoggo avatar dependabot[bot] avatar dowoge avatar drumman22 avatar insyri avatar liquidwater0 avatar

Stargazers

 avatar  avatar

bhop-bot-ts's Issues

[Tracking] Optimizing readability/performance for the insardia command.

Issue Information

This issue will be held for optimization notes for the insardia command.

Goal: Less "wtfs" on the code; code clarity, readability, and removing unnecessary parts.

Tracking

P1: alternatives map

let alternatives = new Map();
alternatives.set("hi", ["hi", "hizies"]),
alternatives.set("hey", ["hey", "heya"]),
alternatives.set("and", ["and", "n"]),
alternatives.set("you", ["yu", "you", "u"]),
alternatives.set("are", ["are", "r"]),
alternatives.set("got", ["got", "gto", "tog"]);

I forgot why exactly I used a map here, I think this can be shortened into an object for less memory movement. Implementation would be rather easy as it would basically transform the Map to an Object using Object.fromEntries, demo:

let alternatives = new Map();
alternatives.set("hi", ["hi", "hizies"]),
  alternatives.set("hey", ["hey", "heya"]),
  alternatives.set("and", ["and", "n"]),
  alternatives.set("you", ["yu", "you", "u"]),
  alternatives.set("are", ["are", "r"]),
  alternatives.set("got", ["got", "gto", "tog"]);

let alternativesobj = Object.fromEntries(alternatives);
console.log(alternativesobj)

And then overwrite the variable via coding not executing.

P2: Lines

let lines = args.insardia.split("\n");
let formatted_string = "";
for (let line of lines) {

wtf.

@drumman22 If you remember, could you explain why you chose to split the entire string by the newlines or at least remember if this was a relevant string of code to implement? AFAIK this wouldn't change anything in output.

P3: Recursive ifs

if (word.length - 1 > 3) {
if (index > 0 && index < word.length - 1) {
let alpha = /[a-zA-Z]/;
if (word[index + 1]?.match(alpha)) {
if (word[index + 1] == letter) {
continue;
}
if (vowels.includes(letter)) {
continue;
}
}
}
}

All these checks lead up to a continue, I'm not sure what would change if it is removed, I would need to do some more research into what exactly continue does.

MDN reference for continue.

P4: Merging duplicate conditions

if (index === 0) {
rng = getRng(50);
if (rng == 1) {
new_word += letter + letter;
}
}
if (index === word.length - 1) {
rng = getRng(50);
if (rng == 1) {
new_word += letter + letter;
}
}

Literally just:

if (index === 0 || index === word.length - 1) {
  if (getRng(50) === 1) new_word += letter + letter; // Some way to shorten letter + letter?
}

P5: Merge P3 and P4

In short, put P4 inside of P3's condition checking, fundamentally replacing where continue is with P4.

Cleanup

As of now, these are all the specific/critical issues to be resolved. Any more input or follow up is welcome to be commented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.