Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Julia Englund

Greenhorn
+ Follow
since May 19, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
1
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julia Englund

Hello. I have been learning JavaScript for under a week so forgive me if there is an easy solution for my problem as I can't find it.
I have made this roller to print a random DNA for a creatable character and it's otherwise done and ready, except for one problem: The part where it rolls MarkRoll() it should not give multiple same values but rather every value being unique. I want to keep the outcome sorted alphabetically for logging purposes.
I have tried multiple different solutions ie. combining the repeated values into showing only one with .splice, making a new list/array of the chosen random values from the original array and few other I don't even remember out of frustration. None of them worked, it just keeps showing multiple same values.

Thank you beforehand for helping out.

(Also sorry if it looks messy, it just makes sense to me to keep that in the current order with all the comments in between, helps me find what I need)

----------------------- EDIT ---------------------

I found the issue as well as the solution for my problem and below is my finished and cleaned up code for a roller that generates random character DNA that is creatable!