-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtic-tac-toe.yml
72 lines (60 loc) · 1.42 KB
/
tic-tac-toe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
# A tic-tac-toe text-console game implemented in Ansible.
# Idea and implementation: Maxim B. Belooussov
- name: Starting a new game
hosts: localhost
connection: local
gather_facts: false
vars:
available_fields: []
A0: " "
A1: " "
A2: " "
B0: " "
B1: " "
B2: " "
C0: " "
C1: " "
C2: " "
board_array:
- name: A0
value: "{{ A0 }}"
- name: A1
value: "{{ A1 }}"
- name: A2
value: "{{ A2 }}"
- name: B0
value: "{{ B0 }}"
- name: B1
value: "{{ B1 }}"
- name: B2
value: "{{ B2 }}"
- name: C0
value: "{{ C0 }}"
- name: C1
value: "{{ C1 }}"
- name: C2
value: "{{ C2 }}"
# there can be only up to 9 moves, so just code them all
tasks:
- name: User makes move 1
import_tasks: usermove.yml
- name: We make move 2
import_tasks: ourmove.yml
- name: User makes move 3
import_tasks: usermove.yml
- name: We make move 4
import_tasks: ourmove.yml
- name: User makes move 5
import_tasks: usermove.yml
- name: We make move 6
import_tasks: ourmove.yml
- name: User makes move 7
import_tasks: usermove.yml
- name: We make move 8
import_tasks: ourmove.yml
- name: User makes move 9
import_tasks: usermove.yml
- name: We run out of moves
debug:
msg: "No more moves left!"