rules_ai 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rules_ai.rb +179 -178
- data/lib/rules_ai/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 288b2167dde783360e7875c09ac620577c08d5f8dab22876a4058e9eb3aea1da
|
4
|
+
data.tar.gz: 2cd87888de329e274910b9487c2065682279149691ce508df056b220a6e00e78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3952a4e1f0be18f47f997766800e6f72fc13f40919e547446a3132238d3db939d166090a03c35d5568b2a6165c506d4626d99eb06d23cf582c9705f94b66c758
|
7
|
+
data.tar.gz: ad2576b892f6d494953279ff0245d315dab9bab2a528ddf41f288593ec17b0167f6a19a137b782eeadd20c26f60fd4e683e504789161b4f4fdf6ad3f5d3f623c
|
data/lib/rules_ai.rb
CHANGED
@@ -125,184 +125,185 @@ module RulesAi
|
|
125
125
|
puts "The total ream count is: #{actual_multiplier} reams of #{ream_size} pages."
|
126
126
|
puts "With front and back cover, the final bound book is #{total_count} pages."
|
127
127
|
end
|
128
|
+
|
129
|
+
def self.calculate_hyper
|
130
|
+
print "What is the size of x? >> "; x = gets.chomp.to_i
|
131
|
+
print "What is the size of y? >> "; y = gets.chomp.to_i
|
132
|
+
print "What is the size of z? >> "; z = gets.chomp.to_i
|
133
|
+
|
134
|
+
square_x = x * 48
|
135
|
+
square_y = y * 48
|
136
|
+
square_z = z * 48
|
137
|
+
|
138
|
+
inches = x + y + z
|
139
|
+
hyper_inches = square_x + square_y + square_z
|
140
|
+
|
141
|
+
puts "\nThe size of the w axis of x is hyper distance #{square_x}"
|
142
|
+
puts "The size of the w axis of y is hyper distance #{square_y}"
|
143
|
+
puts "The size of the w axis of z is hyper distance #{square_z}"
|
144
|
+
|
145
|
+
puts "The hyper inches of the tessaract is #{hyper_inches} hyper distance."
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.line
|
149
|
+
puts '
|
150
|
+
+----------------+
|
151
|
+
'
|
152
|
+
end
|
153
|
+
|
154
|
+
def self.square
|
155
|
+
puts '
|
156
|
+
+----------------+
|
157
|
+
| |
|
158
|
+
| |
|
159
|
+
| |
|
160
|
+
| |
|
161
|
+
| |
|
162
|
+
| |
|
163
|
+
| |
|
164
|
+
+----------------+
|
165
|
+
'
|
166
|
+
end
|
167
|
+
|
168
|
+
def self.cube
|
169
|
+
puts '
|
170
|
+
+----------------+
|
171
|
+
|\ |\
|
172
|
+
| \ | \
|
173
|
+
| \ | \
|
174
|
+
| +------------+---+
|
175
|
+
| | | |
|
176
|
+
| | | |
|
177
|
+
| | | |
|
178
|
+
+---+------------+ |
|
179
|
+
\ | \ |
|
180
|
+
\ | \ |
|
181
|
+
\| \|
|
182
|
+
+----------------+
|
183
|
+
'
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.hyper
|
187
|
+
puts '
|
188
|
+
+----------------+
|
189
|
+
/|\ /|\
|
190
|
+
/ | \ / | \
|
191
|
+
/ | \ / | \
|
192
|
+
/ | +--------+---+---+
|
193
|
+
/ | /| / | /|
|
194
|
+
/ | / | / | / |
|
195
|
+
/ |/ | / |/ |
|
196
|
+
/ +---+----+-------+ |
|
197
|
+
/ / \ | / / \ |
|
198
|
+
/ / \ | / / \ |
|
199
|
+
/ / \| / / \|
|
200
|
+
+--------+-------+--------+-------+
|
201
|
+
|\ / /|\ / /
|
202
|
+
| \ / / | \ / /
|
203
|
+
| \ / / | \ / /
|
204
|
+
| ++-------+---+---+/ /
|
205
|
+
| + / | + /
|
206
|
+
| /| / | /| /
|
207
|
+
| / | / | / | /
|
208
|
+
+---+----+-------+/ | /
|
209
|
+
\ | / \ | /
|
210
|
+
\ | / \ | /
|
211
|
+
\| / \| /
|
212
|
+
+----------------+
|
213
|
+
'
|
214
|
+
end
|
128
215
|
end
|
129
216
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
#
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
#
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
#
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
#
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
#
|
193
|
-
#
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
#
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
#
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
#
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
# end
|
223
|
-
#
|
224
|
-
# end
|
225
|
-
#
|
226
|
-
# class Chatbot
|
227
|
-
# Bianca asks your name.
|
228
|
-
#def bianca_name
|
229
|
-
# bot_name = File.read("bot_identity/name.txt").strip
|
230
|
-
# your_name = File.read("usr_identity/name.txt").strip
|
231
|
-
#
|
232
|
-
# puts "#{bot_name}: What is your name?"
|
233
|
-
# print "#{your_name}: My name is "; my_name = gets.chomp
|
234
|
-
#
|
235
|
-
# open("usr_identity/name.txt", "w") { |f|
|
236
|
-
# f.puts my_name
|
237
|
-
# }
|
238
|
-
#
|
239
|
-
# puts "#{bot_name}: Nice to meet you, #{my_name}."
|
240
|
-
#end
|
241
|
-
#
|
242
|
-
# Bianca asks if you have a pet.
|
243
|
-
#def bianca_pets
|
244
|
-
# bot_name = File.read("bot_identity/name.txt").strip
|
245
|
-
# your_name = File.read("usr_identity/name.txt").strip
|
246
|
-
#
|
247
|
-
# puts "#{bot_name}: Do you have a pet?"
|
248
|
-
# print "#{your_name}: My pet is "; my_pet = gets.chomp
|
249
|
-
#
|
250
|
-
# open("usr_identity/pet.txt", "w") { |f|
|
251
|
-
# f.puts my_pet
|
252
|
-
# }
|
253
|
-
#
|
254
|
-
# puts "#{bot_name}: You have a nice #{my_pet}."
|
255
|
-
#end
|
256
|
-
#
|
257
|
-
# Bianca asks what your hobby is.
|
258
|
-
#def bianca_hobby
|
259
|
-
# bot_name = File.read("bot_identity/name.txt").strip
|
260
|
-
# your_name = File.read("usr_identity/name.txt").strip
|
261
|
-
#
|
262
|
-
# puts "#{bot_name}: What is your hobby?"
|
263
|
-
# print "#{your_name}: My hobby is "; my_hobby = gets.chomp
|
264
|
-
#
|
265
|
-
# open("usr_identity/hobby.txt", "w") { |f|
|
266
|
-
# f.puts my_hobby
|
267
|
-
# }
|
268
|
-
#
|
269
|
-
# puts "#{bot_name}: You have a nice #{my_hobby}."
|
270
|
-
#end
|
271
|
-
#
|
272
|
-
#def bianca_jobs
|
273
|
-
# bot_name = File.read("bot_identity/name.txt").strip
|
274
|
-
# your_name = File.read("usr_identity/name.txt").strip
|
275
|
-
#
|
276
|
-
# puts "#{bot_name}: What is your job?"
|
277
|
-
# print "#{your_name}: My job is "; my_job = gets.chomp
|
278
|
-
#
|
279
|
-
# open("usr_identity/job.txt", "w") { |f|
|
280
|
-
# f.puts my_job
|
281
|
-
# }
|
282
|
-
#
|
283
|
-
# puts "#{bot_name}: Sounds like #{my_job} is hard work."
|
284
|
-
#end
|
285
|
-
#
|
286
|
-
#def bianca_skills
|
287
|
-
# bot_name = File.read("bot_identity/name.txt").strip
|
288
|
-
# your_name = File.read("usr_identity/name.txt").strip
|
289
|
-
#
|
290
|
-
# puts "#{bot_name}: What is your skill?"
|
291
|
-
# print "#{your_name}: My skill is "; my_skill = gets.chomp
|
292
|
-
#
|
293
|
-
# open("usr_identity/skill.txt", "w") { |f|
|
294
|
-
# f.puts my_skill
|
295
|
-
# }
|
296
|
-
#
|
297
|
-
# puts "#{bot_name}: #{my_skill} sounds like an interesting skill."
|
298
|
-
#end
|
299
|
-
#
|
300
|
-
#system("clear")
|
301
|
-
#
|
302
|
-
#bianca_name; sleep(3)
|
303
|
-
#bianca_pets; sleep(3)
|
304
|
-
#bianca_hobby; sleep(3)
|
305
|
-
#bianca_jobs; sleep(3)
|
306
|
-
#bianca_skills; sleep(3)
|
307
|
-
# end
|
217
|
+
class Chatbot
|
218
|
+
|
219
|
+
def self.bianca_name
|
220
|
+
bot_name = File.read("bot_identity/name.txt").strip
|
221
|
+
your_name = File.read("usr_identity/name.txt").strip
|
222
|
+
|
223
|
+
puts "#{bot_name}: What is your name?"
|
224
|
+
print "#{your_name}: My name is "; my_name = gets.chomp
|
225
|
+
|
226
|
+
open("usr_identity/name.txt", "w") { |f|
|
227
|
+
f.puts my_name
|
228
|
+
}
|
229
|
+
|
230
|
+
puts "#{bot_name}: Nice to meet you, #{my_name}."
|
231
|
+
end
|
232
|
+
|
233
|
+
def self.bianca_pets
|
234
|
+
bot_name = File.read("bot_identity/name.txt").strip
|
235
|
+
your_name = File.read("usr_identity/name.txt").strip
|
236
|
+
|
237
|
+
puts "#{bot_name}: Do you have a pet?"
|
238
|
+
print "#{your_name}: My pet is "; my_pet = gets.chomp
|
239
|
+
|
240
|
+
open("usr_identity/pet.txt", "w") { |f|
|
241
|
+
f.puts my_pet
|
242
|
+
}
|
243
|
+
|
244
|
+
puts "#{bot_name}: You have a nice #{my_pet}."
|
245
|
+
end
|
246
|
+
|
247
|
+
def self.bianca_hobby
|
248
|
+
bot_name = File.read("bot_identity/name.txt").strip
|
249
|
+
your_name = File.read("usr_identity/name.txt").strip
|
250
|
+
|
251
|
+
puts "#{bot_name}: What is your hobby?"
|
252
|
+
print "#{your_name}: My hobby is "; my_hobby = gets.chomp
|
253
|
+
|
254
|
+
open("usr_identity/hobby.txt", "w") { |f|
|
255
|
+
f.puts my_hobby
|
256
|
+
}
|
257
|
+
|
258
|
+
puts "#{bot_name}: You have a nice #{my_hobby}."
|
259
|
+
end
|
260
|
+
|
261
|
+
def self.bianca_jobs
|
262
|
+
bot_name = File.read("bot_identity/name.txt").strip
|
263
|
+
your_name = File.read("usr_identity/name.txt").strip
|
264
|
+
|
265
|
+
puts "#{bot_name}: What is your job?"
|
266
|
+
print "#{your_name}: My job is "; my_job = gets.chomp
|
267
|
+
|
268
|
+
open("usr_identity/job.txt", "w") { |f|
|
269
|
+
f.puts my_job
|
270
|
+
}
|
271
|
+
|
272
|
+
puts "#{bot_name}: Sounds like #{my_job} is hard work."
|
273
|
+
end
|
274
|
+
|
275
|
+
def self.bianca_skills
|
276
|
+
bot_name = File.read("bot_identity/name.txt").strip
|
277
|
+
your_name = File.read("usr_identity/name.txt").strip
|
278
|
+
|
279
|
+
puts "#{bot_name}: What is your skill?"
|
280
|
+
print "#{your_name}: My skill is "; my_skill = gets.chomp
|
281
|
+
|
282
|
+
open("usr_identity/skill.txt", "w") { |f|
|
283
|
+
f.puts my_skill
|
284
|
+
}
|
285
|
+
|
286
|
+
puts "#{bot_name}: #{my_skill} sounds like an interesting skill."
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
class New_Routine # Generates Meta rules
|
291
|
+
|
292
|
+
def self.generate_ruleset
|
293
|
+
ruleset = File.readlines("data/rules/input.txt")
|
294
|
+
|
295
|
+
scatter_rules = ruleset.shuffle
|
296
|
+
|
297
|
+
puts "Generated Rules:\n#{scatter_rules}"
|
298
|
+
|
299
|
+
open("new_routine.rb", "w") { |f|
|
300
|
+
puts 'require "rules_ai"'
|
301
|
+
puts "\n#{scatter_rules}"
|
302
|
+
}
|
303
|
+
end
|
304
|
+
|
305
|
+
def self.test_rule
|
306
|
+
system("ruby new_routine.rb")
|
307
|
+
end
|
308
|
+
end
|
308
309
|
end
|
data/lib/rules_ai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rules_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gitea
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This is a collection of different rules based functions, from calculating
|
14
14
|
how many hours have passed, tesla multiplication, autonomous prompting ( such as
|