-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): prepare action loop feature
- Loading branch information
Showing
7 changed files
with
73 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
|
||
import utils | ||
|
||
def guess(params): | ||
"""This is a test""" | ||
|
||
entities, slots = params['entities'], params['slots'] | ||
given_nb = -1 | ||
nb_to_guess = 42 # TODO: pick up from DB | ||
|
||
# Find entities | ||
for item in params['entities']: | ||
if item['entity'] == 'number': | ||
given_nb = item['resolution']['value'] | ||
|
||
if given_nb == nb_to_guess: | ||
return utils.output('end', 'guessed', '....CONGRATS....') | ||
if nb_to_guess < given_nb: | ||
# TODO: enable loop | ||
return utils.output('end', 'smaller', utils.translate('smaller') | ||
if nb_to_guess > given_nb: | ||
# TODO: enable loop | ||
return utils.output('end', 'bigger', utils.translate('bigger') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters