Also on a side note, this is my first day signed up here, so nice to meet you all
EOS Help
EOS Help
I want to make a coin toss using the IF statement tool on eos. It's not calling variables or functions I make in any evals, and the things I make in the if statement are only outputting a single result. It also doesn't help that I suck at coding java-script/coding in general. If anyone here can help/write up a line of java for me I would really appreciate it
.
Also on a side note, this is my first day signed up here, so nice to meet you all
Also on a side note, this is my first day signed up here, so nice to meet you all
- Shattered
- Experimentor

- Posts: 1391
- Joined: Fri Jan 11, 2013 6:41 pm
- I am a: Switch
- Location: United Kingdom
Re: EOS Help
Maybe an easier way for you with no coding required:
if you put * after a page name on a goto, itll go to a random apge with that name.
so if we made
cointossheads
and
cointosstails
as pages, then went
goto -> cointoss*
it would go to a random cointoss result!
If you want a lot of coin tosses might not be great but thats a simple way.
if you put * after a page name on a goto, itll go to a random apge with that name.
so if we made
cointossheads
and
cointosstails
as pages, then went
goto -> cointoss*
it would go to a random cointoss result!
If you want a lot of coin tosses might not be great but thats a simple way.
Salutations, Stranger.
--
Like my work and want to see more? Consider supporting my Patreon or buying me a Ko-fi!
Try my teases on Milovana!
--
Like my work and want to see more? Consider supporting my Patreon or buying me a Ko-fi!
Try my teases on Milovana!
Re: EOS Help
I am doing a lot of coin tosses, but I think I might have to roll with that
Thanks sm
Thanks sm
-
Roblsforbobls
- Explorer At Heart

- Posts: 272
- Joined: Tue May 21, 2019 2:27 am
- Gender: Male
- Sexual Orientation: Asexual
- I am a: Switch
Re: EOS Help
Hi subm13,subm13 wrote: Tue Apr 14, 2020 5:03 am I am doing a lot of coin tosses, but I think I might have to roll with that![]()
Thanks sm![]()
Anytime I need to generate a random number, I copy-paste this into an eval action:
Code: Select all
var myNumber = Math.floor((Math.random() * 20) + 1);
console.log('The number is %s', myNumber)For a coin toss I suggest using 1 = heads and 2 = tails.
When using if actions, make sure to use 2 or 3 equals signs (I usually just do 3). Ex:
Code: Select all
if:
myNumber === 1
then:
Say: "Heads!"One last trick I use all the time:
Code: Select all
CurrentPage = pages.getCurrentPageId();Learning Eos takes time and there are a lot of tricks and kinks that you learn through practice and experimenting. The forums have a lot of good QandA bout Eos - that's where a lot of us coding newbies learned some basics. I recommend checking out the eos tutorial and the coding APIs in there too. It'll get easier to use as you go! I hope this helps, and welcome to the community!
-
undeniable_denial
- Explorer At Heart

- Posts: 109
- Joined: Sat Aug 24, 2019 11:42 am
- Gender: Male
- Location: Germany
Re: EOS Help
I completely agree with the previous answers, but since you are
I thought you might be interested in a compact alternative. Stick this into an if:
Code: Select all
Math.random()<.5Re: EOS Help
If your if statement only has 1 equals sign, instead of checking to see if your variable is 1, for ex, it will just set the variable equal to 1. That's why I think you're only getting one output from your if statements.
Ah that makes a lot of sense, I was making that mistake a lot. I decided to roll with the suggestion made by the other guy, but that you so much for the in-depth response, I'm sure it'll be super helpful with anything I try to make in the future/if I decide to revamp the one I already made.
Re: EOS Help
Thanks sm, honestly the more compact and simple the better for me. I might try this as well.undeniable_denial wrote: Tue Apr 14, 2020 11:05 am I completely agree with the previous answers, but since you areI thought you might be interested in a compact alternative. Stick this into an if:Code: Select all
Math.random()<.5

