mumuki-puzzle-runner 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c06f3a9c0ab060ce1746fbd08687e44bdd3edc9d2bd7bc9f27991cfa56d34e96
4
- data.tar.gz: 3fd982c69ed60580166016ad4824be96a67b5480d238311e347c7588e86ededd
3
+ metadata.gz: 441d4b26b7b8308cc9ed1ec7aca6de3c03905a6018af2db5d1d5e9889b72b55d
4
+ data.tar.gz: 5ccb1d263bc6e5c60f62d247006faa81d9a5647518939c0e9b2159092a3fdc45
5
5
  SHA512:
6
- metadata.gz: 594855995d69d145ceb3294c3bfc571d681a18e5983e9130884bde9508feea77519764066ceb7fa6b843923dfebc728bfe8a5cf3f08058c9aacc5362f4e784c5
7
- data.tar.gz: 6f2d79e5203433e39a8d0bcea6ca80442f8eac32e3eb3d72f04fbadd82490578836444f0c57ad93163d74c9bbbcbcec268b04c97a77d33a2152d191b73cdfba8
6
+ metadata.gz: d68ffd2617b06416d0e377a46c0bbb89f2728267d79866e31dc7afbaea88d9c22f1df2390ae0bac3a662c610ecc1f8234dec6bd9ca658d9714eea4412ef8e2fb
7
+ data.tar.gz: 5c83e99fc78f6f4043e65b5da66a1587a4398a3247d322985d5140976601d69feec3ebadcf9c1de0e86b1ce2208055414af1c87da08e97bf809ee256ff856877
@@ -3,14 +3,15 @@ class PuzzleMetadataHook < Mumukit::Hook
3
3
  {
4
4
  language: {
5
5
  name: 'muzzle',
6
- version: '1.0.0',
6
+ version: PuzzleVersionHook::VERSION,
7
7
  extension: 'js',
8
8
  ace_mode: 'javascript'
9
9
  },
10
10
  test_framework: {
11
11
  name: 'muzzle',
12
- version: '1.0.0',
13
- test_extension: 'js'
12
+ version: PuzzleVersionHook::VERSION,
13
+ test_extension: 'js',
14
+ template: "// see more examples at https://github.com/mumuki/mumuki-puzzle-runner\nMuzzle.basic(3, 2, 'https://flbulgarelli.github.io/headbreaker/static/berni.jpg');"
14
15
  },
15
16
  layout_assets_urls: {
16
17
  js: [
@@ -31,6 +31,7 @@ $(() => {
31
31
  // mumuki's solution processing
32
32
  const _onSubmit = Muzzle.onSubmit;
33
33
  Muzzle.onSubmit = (submission) => {
34
+ console.log(`submitting ${submission}`)
34
35
  mumuki.submission.processSolution(submission);
35
36
  _onSubmit(submission);
36
37
  }
@@ -64,14 +64,14 @@ class MuzzleCanvas {
64
64
  *
65
65
  * @type {number}
66
66
  */
67
- this.canvasWidth = 800;
67
+ this.canvasWidth = 600;
68
68
 
69
69
  /**
70
70
  * Height of canvas
71
71
  *
72
72
  * @type {number}
73
73
  */
74
- this.canvasHeight = 800;
74
+ this.canvasHeight = 600;
75
75
 
76
76
  /**
77
77
  * Size of fill. Set null for perfect-match
@@ -80,6 +80,13 @@ class MuzzleCanvas {
80
80
  */
81
81
  this.borderFill = null;
82
82
 
83
+ /**
84
+ * Canvas line width
85
+ *
86
+ * @type {number}
87
+ */
88
+ this.strokeWidth = 1.5;
89
+
83
90
  /**
84
91
  * Piece size
85
92
  *
@@ -141,7 +148,7 @@ class MuzzleCanvas {
141
148
  pieceSize: this.pieceSize,
142
149
  proximity: this.pieceSize / 5,
143
150
  borderFill: this.borderFill === null ? this.pieceSize / 10 : this.borderFill,
144
- strokeWidth: 1.5,
151
+ strokeWidth: this.strokeWidth,
145
152
  lineSoftness: 0.18
146
153
  };
147
154
  }
@@ -470,7 +477,15 @@ const Muzzle = new class extends MuzzleCanvas {
470
477
  super();
471
478
  this.aux = {};
472
479
  }
473
- another = (id) => {
480
+
481
+ /**
482
+ * Creates a suplementary canvas at the element
483
+ * of the given id
484
+ *
485
+ * @param {string} id
486
+ * @returns {MuzzleCanvas}
487
+ */
488
+ another(id) {
474
489
  const muzzle = new MuzzleCanvas(id);
475
490
  Muzzle.aux[id] = muzzle
476
491
  return muzzle;
@@ -1,3 +1,3 @@
1
1
  module PuzzleVersionHook
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-puzzle-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit