-
Posts
5883 -
Joined
-
Last visited
-
Days Won
18 -
Feedback
100%
Posts posted by Botre
-
-
Stop wasting your computer's resources, use an online render-farm service.
-
-
This might inspire you
http://osbot.org/forum/topic/93716-t13-introduction-to-simplog-lightweight-logging/
-
hi
nice name
- 1
-
-
The issue is that the tabs don't actually switch randomly. Code is compatible but not functioning right.
private static int rngTab = random(0, 125);
private enum Tabs { ATTACK(0, Tab.ATTACK); private int chance; private Tab tab; public int getChance() { return chance; } public Tab getTab() { return tab; } private static Set<Tabs> tab_set = Collections.unmodifiableSet(EnumSet.allOf(Tabs.class)); public static Optional<Tabs> forTabs(int rng) { return tab_set.stream().filter(Objects::nonNull).filter(tabs -> tabs.getChance() == rng).findAny(); } public static void randomTabs(Script script, int chance) { if (rngTab == forTabs(chance).get().getChance()) { script.getTabs().open(forTabs(chance).get().getTab()); } } private Tabs(int chance, Tab tab) { this.chance = chance; this.tab = tab; } }
if (getState() == BotState.FISHING) { Tabs.randomTabs(this, 0); return; }
I know it's overkill, but little better than using switch.
Here is something a tad bit more clean and re-usable/generic
import java.util.Random; public class EnumUtil { public static <T extends Enum<?>> T getRandomEnumValue(Class<T> clazz, Random random) { int constants = clazz.getEnumConstants().length; if(constants == 0) { throw new IllegalArgumentException("Enum class has no constants"); } return clazz.getEnumConstants()[random.nextInt(constants)]; } public static void main(String[] args) { Random random = new Random(); Tab tab = EnumUtil.getRandomEnumValue(Tab.class, random); } }
- 1
-
So much overkill in your code x)
-
-
I've never encountered anyone like this irl tbh...
-
bravissimo
-
Red eyes are a bit of a trope...
Other than that, super sexy
-
The Hashtable class is obsolete.
You're using a Hashtable without overriding the key class' hashCode() & equals() methods.
You hardcoded your base case (if 4 == r).
3 ints and 2 object references per node. Memory.
Redundant calls to table.contains(key) & table.get(key).The way you construct your TreeNode class is the opposite of elegant and intuitive.
Your algo might not be O(n^2) but if your pseudo code looked anything like this Java implementation, I can't blame the TA for not giving you a perfect grade.
- 1
-
"Now with the facts
Rumor tells..."
-
Unfortunately I haven't mastered much of the domain-specific vocabulary that would allow me to express my subjective opinion in a way that would help your artistic progress.
But I won't let that silence me nor turn me into a liar.
shit
*goes away*
Just because someone is unable to express an opinion doesn't mean he's not entitled to it
-
You can vote no but you're forced to pick a > 1 $ donation option at the same time.
Nice try fucking scamming piece of shit.
Oliver4TWC
- 1
-
looooooooooool
this is getting cray
-
-
-
- 2
-
-
-
You're negative for calling most people negative.
Fuck now I'm being negative about you.
Rip.
- 1
-
-
The new generation's in ; )
Enjoy the road young padawans!
- 1
Im dying... Laughing out loud alone in my room. this shit is gold
in Spam/Off Topic
Posted
Nope