BequestSpoonerismeDeTairu 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f98fc90a50ea1832d612ad887af20ec57aaf4a55effd279d8cd88a19bf3cd9d8
4
+ data.tar.gz: 7916ae7d557c5ce6ecfaefc92788f0e0ebeeb32d2c0fd56bb694dae8813febda
5
+ SHA512:
6
+ metadata.gz: 8be1161888d58565128edffa3caa18ef9d65a7ca21f4f8ea67ba416682c13d5b2e02f57176038e300f656c0d7cfe26563a16cc04a69d163c0a7eeb0cd5b546d6
7
+ data.tar.gz: 614c0f25f5940ebe403b13b2be05f915b61461309cbce0db655d2f7eb407d743436d75e7bdf77639037a8f0ca5504fb07e5d48482e3a94a13ee7325798354e8b
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # BequestSpoonerismeDeTairu
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/BequestSpoonerismeDeTairu`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ ```bash
14
+ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15
+ ```
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by executing:
18
+
19
+ ```bash
20
+ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/BequestSpoonerismeDeTairu.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BequestSpoonerismeDeTairu
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "BequestSpoonerismeDeTairu/version"
4
+
5
+ module BequestSpoonerismeDeTairu
6
+ class Error < StandardError; end
7
+
8
+ class Tilemap
9
+ def self.generate_input
10
+ word_class = [
11
+ [["le", "le"], ["le", "le"], ["le", "les"]],
12
+ [["la", "le"], ["la", "le"], ["la", "les"]],
13
+ [["les", "le"], ["les", "le"], ["les", "les"]],
14
+ ]
15
+
16
+ row_options = [0, 1, 2]
17
+ col_options = [0, 1, 2]
18
+
19
+ arr_options = [0, 1]
20
+
21
+ cur_row = row_options.sample
22
+ cur_col = col_options.sample
23
+ cur_arr = arr_options.sample
24
+
25
+ @new_word_class = word_class[cur_row][cur_col][cur_arr]
26
+
27
+ nouns = [
28
+ [["pomme", "pomme"], ["pomme", "banane"], ["pomme", "pomegranite"]],
29
+ [["banane", "pomme"], ["banane", "banane"], ["banane", "pomegranite"]],
30
+ [["pomegranite", "pomme"], ["pomegranite", "banane"], ["pomegranite", "pomegranite"]],
31
+ ]
32
+
33
+ row_options = [0, 1, 2]
34
+ col_options = [0, 1, 2]
35
+
36
+ arr_options = [0, 1]
37
+
38
+ cur_row = row_options.sample
39
+ cur_col = col_options.sample
40
+ cur_arr = arr_options.sample
41
+
42
+ @new_noun = nouns[cur_row][cur_col][cur_arr]
43
+
44
+ subject = [
45
+ [["je", "je"], ["je", "vous"], ["je", "tu"]],
46
+ [["vous", "je"], ["vous", "vous"], ["vous", "tu"]],
47
+ [["tu", "tu"], ["tu", "vous"], ["tu", "tu"]],
48
+ ]
49
+
50
+ row_options = [0, 1, 2]
51
+ col_options = [0, 1, 2]
52
+
53
+ arr_options = [0, 1]
54
+
55
+ cur_row = row_options.sample
56
+ cur_col = col_options.sample
57
+ cur_arr = arr_options.sample
58
+
59
+ @new_subject = subject[cur_row][cur_col][cur_arr]
60
+
61
+ verbs = [
62
+ [["manger", "mange"], ["manger", "jete"], ["manger", "conserver"]],
63
+ [["jete", "mange"], ["jete", "jete"], ["jete", "conserver"]],
64
+ [["conserver", "mange"], ["conserver", "jete"], ["conserver", "conserver"]],
65
+ ]
66
+
67
+ row_options = [0, 1, 2]
68
+ col_options = [0, 1, 2]
69
+
70
+ arr_options = [0, 1]
71
+
72
+ cur_row = row_options.sample
73
+ cur_col = col_options.sample
74
+ cur_arr = arr_options.sample
75
+
76
+ @new_verbs = verbs[cur_row][cur_col][cur_arr]
77
+
78
+ @new_input = "#{@new_word_class} #{@new_noun} #{@new_subject} #{@new_verbs}"
79
+ end
80
+
81
+ # Convert to a reciprocal cipher that uses a randomized key.
82
+ def self.convert_to_ranrec
83
+ keys1 = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
84
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ].shuffle
85
+
86
+ ## Create new reciprocal keypair
87
+ alph_1 = keys1[0] + keys1[1] + keys1[2] + keys1[3] + keys1[4] + keys1[5] + keys1[6] + keys1[7] + keys1[8] +
88
+ keys1[9] + keys1[10] + keys1[11] + keys1[13] + keys1[13] + keys1[14] + keys1[15] + keys1[16] + keys1[17] +
89
+ keys1[18] + keys1[19] + keys1[20] + keys1[21] + keys1[22] + keys1[23] + keys1[24] + keys1[25]
90
+
91
+ alph_2 = keys1[13] + keys1[14] + keys1[15] + keys1[16] + keys1[17] + keys1[18] + keys1[19] + keys1[20] +
92
+ keys1[21] + keys1[22] + keys1[23] + keys1[24] + keys1[25] + keys1[0] + keys1[1] + keys1[2] +
93
+ keys1[3] + keys1[4] + keys1[5] + keys1[6] + keys1[7] + keys1[8] + keys1[9] + keys1[10] +
94
+ keys1[11] + keys1[13]
95
+
96
+ ## Save a copy of the keys for later decryption
97
+ open("_data/audit/keys1.txt", "w") { |f|
98
+ f.puts alph_1
99
+ }
100
+
101
+ open("_data/audit/keys2.txt", "w") { |f|
102
+ f.puts alph_2
103
+ }
104
+ end
105
+
106
+ ## Checks to see if output is properly decrypted.
107
+ def self.check_if_decrypted
108
+ first_key = File.read("_data/audit/keys1.txt")
109
+ second_key = File.read("_data/audit/keys2.txt")
110
+
111
+ # Due to its reciprocal nature, this means that any direction is a valid cryptographic key.
112
+ encrypted = @new_input.tr first_key, second_key
113
+ decrypted = @encrypted.tr first_key, second_key
114
+
115
+ puts "#{encrypted} | #{decrypted}"
116
+ end
117
+
118
+ # Purge reciprocal keys when no longer needed.
119
+ def self.purge_keypair
120
+ system("cd _data/audit; rm keys1.txt; rm keys2.txt; touch cat.txt")
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,4 @@
1
+ module BequestSpoonerismeDeTairu
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: BequestSpoonerismeDeTairu
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - LWFlouisa
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-07-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Generates spoonerisms in a ficticious language based on Francais with
14
+ influence from Japanese.
15
+ email:
16
+ - lwflouisa@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - Rakefile
23
+ - lib/BequestSpoonerismeDeTairu.rb
24
+ - lib/BequestSpoonerismeDeTairu/version.rb
25
+ - sig/BequestSpoonerismeDeTairu.rbs
26
+ homepage: https://lwflouisa.itch.io/
27
+ licenses: []
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: 3.0.0
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubygems_version: 3.3.5
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: For generating spoonerisms in the context of Bequest De Cendres.
48
+ test_files: []