@@ -14,130 +14,157 @@ locals {
14
14
}
15
15
}
16
16
17
- module "word_one " {
18
- source = " ./checker "
19
- input = data . coder_parameter . first . value
17
+ module "one " {
18
+ source = " ./word "
19
+ index = 0
20
20
correct = local. correct
21
+ pattern = " ."
21
22
}
22
23
23
- data "coder_parameter" "first" {
24
- name = " first"
25
- display_name = " First word"
26
- description = " Enter a 5 letter word"
27
- type = " string"
28
- order = 1
29
-
30
- validation {
31
- regex = local. validation . regex
32
- error = local. validation . error
33
- }
34
- }
35
-
36
- // ---
37
- module "word_two" {
38
- source = " ./checker"
39
- input = data. coder_parameter . second [0 ]. value
40
- correct = local. correct
41
- }
42
-
43
- data "coder_parameter" "second" {
44
- count = 1
45
- # count = length(data.coder_parameter.first.value) == 5 ? 1 : 0
46
-
47
- name = " second"
48
- display_name = " Second word"
49
- description = " Previous word matches: ${ module . word_one . result } "
50
- type = " string"
51
- order = 2
52
-
53
- validation {
54
- regex = local. validation . regex
55
- error = local. validation . error
56
- }
57
- }
58
-
59
- // ---
60
- module "word_three" {
61
- source = " ./checker"
62
- input = data. coder_parameter . third [0 ]. value
24
+ module "two" {
25
+ count = module. one . valid ? 1 : 0
26
+ source = " ./word"
27
+ index = 1
63
28
correct = local. correct
29
+ pattern = module. one . result
64
30
}
65
31
66
- data "coder_parameter" "third" {
67
- count = 1
68
- # count = try(length(data.coder_parameter.second[0].value) == 5, false) ? 1 : 0
69
-
70
- name = " third"
71
- display_name = " Third word"
72
- description = " Previous word matches: ${ module . word_two . result } "
73
- type = " string"
74
- order = 3
75
-
76
- validation {
77
- regex = local. validation . regex
78
- error = local. validation . error
79
- }
80
- }
81
-
82
- // ---
83
- module "word_four" {
84
- source = " ./checker"
85
- input = data. coder_parameter . fourth [0 ]. value
86
- correct = local. correct
32
+ data "coder_parameter" "dump" {
33
+ name = " dump"
34
+ display_name = " ${ module . one . valid } "
35
+ description = " Dump the state"
36
+ type = " string"
37
+ order = 100
38
+ default = " "
87
39
}
88
40
89
- data "coder_parameter" "fourth" {
90
- count = 1
91
- name = " fourth"
92
- display_name = " Fourth word"
93
- description = " Previous word matches: ${ module . word_three . result } "
94
- type = " string"
95
- order = 4
96
-
97
- validation {
98
- regex = local. validation . regex
99
- error = local. validation . error
100
- }
101
- }
102
-
103
- // ---
104
- module "word_five" {
105
- source = " ./checker"
106
- input = data. coder_parameter . fifth [0 ]. value
107
- correct = local. correct
108
- }
109
41
110
- data "coder_parameter" "fifth" {
111
- count = 1
112
- name = " fifth"
113
- display_name = " Fifth word"
114
- description = " Previous word matches: ${ module . word_four . result } "
115
- type = " string"
116
- order = 5
117
42
118
- validation {
119
- regex = local. validation . regex
120
- error = local. validation . error
121
- }
122
- }
123
-
124
- // ---
125
- # module "word_six" {
43
+ #
44
+ # module "word_one" {
126
45
# source = "./checker"
127
- # input = data.coder_parameter.fifth .value
46
+ # input = data.coder_parameter.first .value
128
47
# correct = local.correct
129
48
# }
130
-
131
- data "coder_parameter" "six" {
132
- count = 1
133
- name = " sixth"
134
- display_name = " Sixth word"
135
- description = " Previous word matches: ${ module . word_five . result } "
136
- type = " string"
137
- order = 6
138
-
139
- validation {
140
- regex = local. validation . regex
141
- error = local. validation . error
142
- }
143
- }
49
+ #
50
+ # data "coder_parameter" "first" {
51
+ # name = "first"
52
+ # display_name = "First word"
53
+ # description = "Enter a 5 letter word"
54
+ # type = "string"
55
+ # order = 1
56
+ #
57
+ # validation {
58
+ # regex = local.validation.regex
59
+ # error = local.validation.error
60
+ # }
61
+ # }
62
+ #
63
+ # // ---
64
+ # module "word_two" {
65
+ # source = "./checker"
66
+ # input = data.coder_parameter.second[0].value
67
+ # correct = local.correct
68
+ # }
69
+ #
70
+ # data "coder_parameter" "second" {
71
+ # count = 1
72
+ # # count = length(data.coder_parameter.first.value) == 5 ? 1 : 0
73
+ #
74
+ # name = "second"
75
+ # display_name = "Second word"
76
+ # description = "Previous word matches: ${module.word_one.result}"
77
+ # type = "string"
78
+ # order = 2
79
+ #
80
+ # validation {
81
+ # regex = local.validation.regex
82
+ # error = local.validation.error
83
+ # }
84
+ # }
85
+ #
86
+ # // ---
87
+ # module "word_three" {
88
+ # source = "./checker"
89
+ # input = data.coder_parameter.third[0].value
90
+ # correct = local.correct
91
+ # }
92
+ #
93
+ # data "coder_parameter" "third" {
94
+ # count = 1
95
+ # # count = try(length(data.coder_parameter.second[0].value) == 5, false) ? 1 : 0
96
+ #
97
+ # name = "third"
98
+ # display_name = "Third word"
99
+ # description = "Previous word matches: ${module.word_two.result}"
100
+ # type = "string"
101
+ # order = 3
102
+ #
103
+ # validation {
104
+ # regex = local.validation.regex
105
+ # error = local.validation.error
106
+ # }
107
+ # }
108
+ #
109
+ # // ---
110
+ # module "word_four" {
111
+ # source = "./checker"
112
+ # input = data.coder_parameter.fourth[0].value
113
+ # correct = local.correct
114
+ # }
115
+ #
116
+ # data "coder_parameter" "fourth" {
117
+ # count = 1
118
+ # name = "fourth"
119
+ # display_name = "Fourth word"
120
+ # description = "Previous word matches: ${module.word_three.result}"
121
+ # type = "string"
122
+ # order = 4
123
+ #
124
+ # validation {
125
+ # regex = local.validation.regex
126
+ # error = local.validation.error
127
+ # }
128
+ # }
129
+ #
130
+ # // ---
131
+ # module "word_five" {
132
+ # source = "./checker"
133
+ # input = data.coder_parameter.fifth[0].value
134
+ # correct = local.correct
135
+ # }
136
+ #
137
+ # data "coder_parameter" "fifth" {
138
+ # count = 1
139
+ # name = "fifth"
140
+ # display_name = "Fifth word"
141
+ # description = "Previous word matches: ${module.word_four.result}"
142
+ # type = "string"
143
+ # order = 5
144
+ #
145
+ # validation {
146
+ # regex = local.validation.regex
147
+ # error = local.validation.error
148
+ # }
149
+ # }
150
+ #
151
+ # // ---
152
+ # # module "word_six" {
153
+ # # source = "./checker"
154
+ # # input = data.coder_parameter.fifth.value
155
+ # # correct = local.correct
156
+ # # }
157
+ #
158
+ # data "coder_parameter" "six" {
159
+ # count = 1
160
+ # name = "sixth"
161
+ # display_name = "Sixth word"
162
+ # description = "Previous word matches: ${module.word_five.result}"
163
+ # type = "string"
164
+ # order = 6
165
+ #
166
+ # validation {
167
+ # regex = local.validation.regex
168
+ # error = local.validation.error
169
+ # }
170
+ # }
0 commit comments