# Function does not work as expected

**URL:** <https://discourse.julialang.org/t/function-does-not-work-as-expected/27449>\
**Category:** New to Julia\
**Created:** [August 12, 2019, 11:24am UTC](https://discourse.julialang.org/t/function-does-not-work-as-expected/27449 "2019-08-12T11:24:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [August 12, 2019, 11:38am UTC](https://discourse.julialang.org/t/function-does-not-work-as-expected/27449/2 "2019-08-12T11:38:16Z")

</div>

First you want to use logical || operator, not the bitwise | operator:

```julia
if roll == 7 || roll == 11

```

and

```julia
elseif roll == 2 || roll == 3 || roll == 12

```

But after this, the function

```julia
diceroll()

```

is not defined for me, but probably for you.

In general, consider the following:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

_[View the full topic](https://discourse.julialang.org/t/function-does-not-work-as-expected/27449)._
