Pick a number between 1 and 10

Samples, Snippets, & Training
Loading Add to Favorites
I'm thinking of a number between 1 and 10. Whoever is the closest wins.
[calc memo="Choose the number of players, have them pick their numbers, then click 'Submit' below." value="score=(Math.floor(Math.random() * 10) + 1);score>10?'':''"]
[select name="playernum" value="1|2|3|4|5|6|7|8|9|10"] <-- How many people are playing?
[conditional field="playernum" condition="(playernum).is('1')||(playernum).is('2')||(playernum).is('3')||(playernum).is('4')||(playernum).is('5')||(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player1name" default="Player 1"] <-- Player 1's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player1pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 1's number
[var name="player1name" memo="Player 1"] --> [calc memo="result" value="score1p=(score) - (player1pick);score1p>8?'Went under by 9':score1p>7?'Went under by 8':score1p>6?'Went under by 7':score1p>5?'Went under by 6':score1p>4?'Went under by 5':score1p>3?'Went under by 4':score1p>2?'Went under by 3':score1p>1?'Went under by 2':score1p>0?'Went under by 1':score1p>-1?'Picked the number':score1p>-2?'Went over by 1':score1p>-3?'Went over by 2':score1p>-3?'Went over by 3':score1p>-4?'Went over by 4':score1p>-5?'Went over by 5':score1p>-6?'Went over by 6':score1p>-7?'Went over by 7':score1p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('2')||(playernum).is('3')||(playernum).is('4')||(playernum).is('5')||(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player2name" default="Player 2"] <-- Player 2's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player2pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 2's number
[var name="player2name" memo="Player 2"] --> [calc memo="result" value="score2p=(score) - (player2pick);score2p>8?'Went under by 9':score2p>7?'Went under by 8':score2p>6?'Went under by 7':score2p>5?'Went under by 6':score2p>4?'Went under by 5':score2p>3?'Went under by 4':score2p>2?'Went under by 3':score2p>1?'Went under by 2':score2p>0?'Went under by 1':score2p>-1?'Picked the number':score2p>-2?'Went over by 1':score2p>-3?'Went over by 2':score2p>-3?'Went over by 3':score2p>-4?'Went over by 4':score2p>-5?'Went over by 5':score2p>-6?'Went over by 6':score2p>-7?'Went over by 7':score2p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('3')||(playernum).is('4')||(playernum).is('5')||(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player3name" default="Player 3"] <-- Player 3's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player3pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 3's number
[var name="player3name" memo="Player 3"] --> [calc memo="result" value="score3p=(score) - (player3pick);score3p>8?'Went under by 9':score3p>7?'Went under by 8':score3p>6?'Went under by 7':score3p>5?'Went under by 6':score3p>4?'Went under by 5':score3p>3?'Went under by 4':score3p>2?'Went under by 3':score3p>1?'Went under by 2':score3p>0?'Went under by 1':score3p>-1?'Picked the number':score3p>-2?'Went over by 1':score3p>-3?'Went over by 2':score3p>-3?'Went over by 3':score3p>-4?'Went over by 4':score3p>-5?'Went over by 5':score3p>-6?'Went over by 6':score3p>-7?'Went over by 7':score3p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('4')||(playernum).is('5')||(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player4name" default="Player 4"] <-- Player 4's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player4pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 4's number
[var name="player4name" memo="Player 4"] --> [calc memo="result" value="score4p=(score) - (player4pick);score4p>8?'Went under by 9':score4p>7?'Went under by 8':score4p>6?'Went under by 7':score4p>5?'Went under by 6':score4p>4?'Went under by 5':score4p>3?'Went under by 4':score4p>2?'Went under by 3':score4p>1?'Went under by 2':score4p>0?'Went under by 1':score4p>-1?'Picked the number':score4p>-2?'Went over by 1':score4p>-3?'Went over by 2':score4p>-3?'Went over by 3':score4p>-4?'Went over by 4':score4p>-5?'Went over by 5':score4p>-6?'Went over by 6':score4p>-7?'Went over by 7':score4p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('5')||(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player5name" default="Player 5"] <-- Player 5's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player5pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 5's number
[var name="player5name" memo="Player 5"] --> [calc memo="result" value="score5p=(score) - (player5pick);score5p>8?'Went under by 9':score5p>7?'Went under by 8':score5p>6?'Went under by 7':score5p>5?'Went under by 6':score5p>4?'Went under by 5':score5p>3?'Went under by 4':score5p>2?'Went under by 3':score5p>1?'Went under by 2':score5p>0?'Went under by 1':score5p>-1?'Picked the number':score5p>-2?'Went over by 1':score5p>-3?'Went over by 2':score5p>-3?'Went over by 3':score5p>-4?'Went over by 4':score5p>-5?'Went over by 5':score5p>-6?'Went over by 6':score5p>-7?'Went over by 7':score5p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('6')||(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player6name" default="Player 6"] <-- Player 6's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player6pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 6's number
[var name="player6name" memo="Player 6"] --> [calc memo="result" value="score6p=(score) - (player6pick);score6p>8?'Went under by 9':score6p>7?'Went under by 8':score6p>6?'Went under by 7':score6p>5?'Went under by 6':score6p>4?'Went under by 5':score6p>3?'Went under by 4':score6p>2?'Went under by 3':score6p>1?'Went under by 2':score6p>0?'Went under by 1':score6p>-1?'Picked the number':score6p>-2?'Went over by 1':score6p>-3?'Went over by 2':score6p>-3?'Went over by 3':score6p>-4?'Went over by 4':score6p>-5?'Went over by 5':score6p>-6?'Went over by 6':score6p>-7?'Went over by 7':score6p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('7')||(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player7name" default="Player 7"] <-- Player 7's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player7pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 7's number
[var name="player7name" memo="Player 7"] --> [calc memo="result" value="score7p=(score) - (player7pick);score7p>8?'Went under by 9':score7p>7?'Went under by 8':score7p>6?'Went under by 7':score7p>5?'Went under by 6':score7p>4?'Went under by 5':score7p>3?'Went under by 4':score7p>2?'Went under by 3':score7p>1?'Went under by 2':score7p>0?'Went under by 1':score7p>-1?'Picked the number':score7p>-2?'Went over by 1':score7p>-3?'Went over by 2':score7p>-3?'Went over by 3':score7p>-4?'Went over by 4':score7p>-5?'Went over by 5':score7p>-6?'Went over by 6':score7p>-7?'Went over by 7':score7p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('8')||(playernum).is('9')||(playernum).is('10')"]
[text name="player8name" default="Player 8"] <-- Player 8's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player8pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 8's number
[var name="player8name" memo="Player 8"] --> [calc memo="result" value="score8p=(score) - (player8pick);score8p>8?'Went under by 9':score8p>7?'Went under by 8':score8p>6?'Went under by 7':score8p>5?'Went under by 6':score8p>4?'Went under by 5':score8p>3?'Went under by 4':score8p>2?'Went under by 3':score8p>1?'Went under by 2':score8p>0?'Went under by 1':score8p>-1?'Picked the number':score8p>-2?'Went over by 1':score8p>-3?'Went over by 2':score8p>-3?'Went over by 3':score8p>-4?'Went over by 4':score8p>-5?'Went over by 5':score8p>-6?'Went over by 6':score8p>-7?'Went over by 7':score8p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('9')||(playernum).is('10')"]
[text name="player9name" default="Player 9"] <-- Player 9's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player9pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 9's number
[var name="player9name" memo="Player 9"] --> [calc memo="result" value="score9p=(score) - (player9pick);score9p>8?'Went under by 9':score9p>7?'Went under by 8':score9p>6?'Went under by 7':score9p>5?'Went under by 6':score9p>4?'Went under by 5':score9p>3?'Went under by 4':score9p>2?'Went under by 3':score9p>1?'Went under by 2':score9p>0?'Went under by 1':score9p>-1?'Picked the number':score9p>-2?'Went over by 1':score9p>-3?'Went over by 2':score9p>-3?'Went over by 3':score9p>-4?'Went over by 4':score9p>-5?'Went over by 5':score9p>-6?'Went over by 6':score9p>-7?'Went over by 7':score9p>-8?'Went over by 8':'Went over by 9'"][/conditional][conditional field="playernum" condition="(playernum).is('10')"]
[text name="player10name" default="Player 10"] <-- Player 10's name [comment memo="optional" memo_color="blue" memo_size="small"]
[select name="player10pick" value="1|2|3|4|5|6|7|8|9|10"] <-- Player 10's number
[var name="player10name" memo="Player 10"] --> [calc memo="result" value="score10p=(score) - (player10pick);score10p>8?'Went under by 9':score10p>7?'Went under by 8':score10p>6?'Went under by 7':score10p>5?'Went under by 6':score10p>4?'Went under by 5':score10p>3?'Went under by 4':score10p>2?'Went under by 3':score10p>1?'Went under by 2':score10p>0?'Went under by 1':score10p>-1?'Picked the number':score10p>-2?'Went over by 1':score10p>-3?'Went over by 2':score10p>-3?'Went over by 3':score10p>-4?'Went over by 4':score10p>-5?'Went over by 5':score10p>-6?'Went over by 6':score10p>-7?'Went over by 7':score10p>-8?'Went over by 8':'Went over by 9'"][/conditional]
The number I was thinking of was --> [calc memo="result will show below" value="score3=(score) + 0"]
I'm thinking of a number between 1 and 10. Whoever is the closest wins.
Choose the number of players, have them pick their numbers, then click 'Submit' below.score=(Math.floor(Math.random() * 10) + 1);score>10?'':''
<-- How many people are playing?

The number I was thinking of was --> result will show belowscore3=(score) + 0
Result - Copy and paste this output:

Home Forums Pick a number between 1 and 10

This topic contains 0 replies, has 1 voice, and was last updated by  Mark Morgan MD 1 year, 4 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #7415

    Mark Morgan MD

    A helpful tool to make an unbiased decision. It’s also an example of using javascript math to generate a random number in a SOAPnote form.

    [See the full post at: Pick a number between 1 and 10]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.