How to use moveTo method in Appium Base Driver

Best JavaScript code snippet using appium-base-driver

Run Appium Base Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

android-complex.js

Source: android-complex.js Github

copy
1"use strict";
2
3require("./helpers/setup");
4
5var wd = require("wd"),
6    _ = require('underscore'),
7    actions = require("./helpers/actions"),
8    serverConfigs = require('./helpers/appium-servers'),
9    _p = require('./helpers/promise-utils'),
10    Q = require('q');
11
12wd.addPromiseChainMethod('swipe', actions.swipe);
13
14describe("android complex", function () {
15  this.timeout(300000);
16  var driver;
17  var allPassed = true;
18
19  before(function () {
20    var serverConfig = process.env.SAUCE ?
21      serverConfigs.sauce : serverConfigs.local;
22    driver = wd.promiseChainRemote(serverConfig);
23    require("./helpers/logging").configure(driver);
24
25    var desired = process.env.SAUCE ?
26      _.clone(require("./helpers/caps").android18) :
27      _.clone(require("./helpers/caps").android19);
28    desired.app = require("./helpers/apps").androidApiDemos;
29    if (process.env.SAUCE) {
30      desired.name = 'android - complex';
31      desired.tags = ['sample'];
32    }
33    return driver
34      .init(desired)
35      .setImplicitWaitTimeout(5000);
36  });
37
38  after(function () {
39    return driver
40      .quit()
41      .finally(function () {
42        if (process.env.SAUCE) {
43          return driver.sauceJobStatus(allPassed);
44        }
45      });
46  });
47
48  afterEach(function () {
49    allPassed = allPassed && this.currentTest.state === 'passed';
50  });
51
52  it("should find an element", function () {
53    return driver
54      .elementByXPath('//android.widget.TextView[@text=\'Animation\']')
55      .elementByXPath('//android.widget.TextView')
56        .text().should.become('API Demos')
57      .elementsByXPath('//android.widget.TextView[contains(@text, "Animat")]')
58        .then(_p.filterDisplayed).first()
59      .then(function (el) {
60        if (!process.env.SAUCE) {
61          return el.text().should.become('Animation');
62        }
63      }).elementByName('App').click()
64        .sleep(3000)
65      .elementsByAndroidUIAutomator('new UiSelector().clickable(true)')
66        .should.eventually.have.length.above(10)
67      .elementByXPath('//android.widget.TextView[@text=\'Action Bar\']')
68        .should.eventually.exist
69      .elementsByXPath('//android.widget.TextView')
70        .then(_p.filterDisplayed).first()
71        .text().should.become('API Demos')
72      .back().sleep(1000);
73  });
74
75  it("should scroll", function () {
76    return driver
77      .elementByXPath('//android.widget.TextView[@text=\'Animation\']')
78      .elementsByXPath('//android.widget.TextView')
79      .then(function (els) {
80        return Q.all([
81          els[7].getLocation(),
82          els[3].getLocation()
83        ]).then(function (locs) {
84          console.log('locs -->', locs);
85          return driver.swipe({
86            startX: locs[0].x, startY: locs[0].y,
87            endX: locs[1].x, endY: locs[1].y,
88            duration: 800
89          });
90        });
91      });
92  });
93
94  it("should draw a smiley", function () {
95    function findTouchPaint() {
96      return driver
97        .elementsByClassName('android.widget.TextView')
98        .then(function (els) {
99          return Q.all([
100            els[els.length - 1].getLocation(),
101            els[0].getLocation()
102          ]).then(function (locs) {
103            return driver.swipe({
104              startX: locs[0].x, startY: locs[0].y,
105              endX: locs[1].x, endY: locs[1].y,
106              duration: 800
107            });
108          });
109        }).elementByName('Touch Paint')
110        .catch(function () {
111          return findTouchPaint();
112        });
113    }
114
115    return driver
116      .elementByName('Graphics').click()
117      .then(findTouchPaint)
118      .click()
119      .sleep(5000)
120      .then(function () {
121        var a1 = new wd.TouchAction();
122        a1.press({x: 150, y: 100}).release();
123        var a2 = new wd.TouchAction();
124        a2.press({x: 250, y: 100}).release();
125        var smile = new wd.TouchAction();
126        smile
127          .press({x:110, y:200})
128          .moveTo({x:1, y:1})
129          .moveTo({x:1, y:1})
130          .moveTo({x:1, y:1})
131          .moveTo({x:1, y:1})
132          .moveTo({x:1, y:1})
133          .moveTo({x:2, y:1})
134          .moveTo({x:2, y:1})
135          .moveTo({x:2, y:1})
136          .moveTo({x:2, y:1})
137          .moveTo({x:2, y:1})
138          .moveTo({x:3, y:1})
139          .moveTo({x:3, y:1})
140          .moveTo({x:3, y:1})
141          .moveTo({x:3, y:1})
142          .moveTo({x:3, y:1})
143          .moveTo({x:4, y:1})
144          .moveTo({x:4, y:1})
145          .moveTo({x:4, y:1})
146          .moveTo({x:4, y:1})
147          .moveTo({x:4, y:1})
148          .moveTo({x:5, y:1})
149          .moveTo({x:5, y:1})
150          .moveTo({x:5, y:1})
151          .moveTo({x:5, y:1})
152          .moveTo({x:5, y:1})
153          .moveTo({x:5, y:0})
154          .moveTo({x:5, y:0})
155          .moveTo({x:5, y:0})
156          .moveTo({x:5, y:0})
157          .moveTo({x:5, y:0})
158          .moveTo({x:5, y:0})
159          .moveTo({x:5, y:0})
160          .moveTo({x:5, y:0})
161          .moveTo({x:5, y:-1})
162          .moveTo({x:5, y:-1})
163          .moveTo({x:5, y:-1})
164          .moveTo({x:5, y:-1})
165          .moveTo({x:5, y:-1})
166          .moveTo({x:4, y:-1})
167          .moveTo({x:4, y:-1})
168          .moveTo({x:4, y:-1})
169          .moveTo({x:4, y:-1})
170          .moveTo({x:4, y:-1})
171          .moveTo({x:3, y:-1})
172          .moveTo({x:3, y:-1})
173          .moveTo({x:3, y:-1})
174          .moveTo({x:3, y:-1})
175          .moveTo({x:3, y:-1})
176          .moveTo({x:2, y:-1})
177          .moveTo({x:2, y:-1})
178          .moveTo({x:2, y:-1})
179          .moveTo({x:2, y:-1})
180          .moveTo({x:2, y:-1})
181          .moveTo({x:1, y:-1})
182          .moveTo({x:1, y:-1})
183          .moveTo({x:1, y:-1})
184          .moveTo({x:1, y:-1})
185          .moveTo({x:1, y:-1})
186          .release();
187
188        var ma = new wd.MultiAction().add(a1, a2, smile);
189        return driver.performMultiAction(ma)
190          // so you can see it
191          .sleep(10000)
192          .back().sleep(1000)
193          .back().sleep(1000);
194      });
195  });
196
197});
198
Full Screen

forces.js

Source: forces.js Github

copy
1import { getAreaIdList } from './areas.js'
2
3export const forces = {
4  "1942": {
5    "JA": {
6      "air": {
7        "types": {
8          "A6M": { "cost": 1, "aa": [8, 4], "saa": [4, 2], "aship": null, "asurf": null },
9          "B5N": { "cost": 2, "aa": null, "saa": null, "aship": [6, 3], "asurf": [2, 1] },
10          "D3A": { "cost": 2, "aa": null, "saa": null, "aship": [4, 2], "asurf": [4, 2] },
11          "KI27": { "cost": 1, "aa": [4, 2], "saa": [2, 1], "aship": null, "asurf": null },
12          "KI43": { "cost": 1, "aa": [6, 3] , "saa": [3, 2], "aship": null, "asurf": null },
13          "KI21": { "cost": 2, "aa": null, "saa": null, "aship": [2, 1], "asurf": [6, 3] },
14          "KI48": { "cost": 2, "aa": null, "saa": null, "aship": [2, 1], "asurf": [4, 2] },
15          "G3M": { "cost": 2, "aa": null, "saa": null, "aship": [2, 1], "asurf": [4, 2] },
16          "G4M": { "cost": 2, "aa": null, "saa": null, "aship": [4, 2], "asurf": [4, 2] },
17          "A6M-G4M": { "cost": 3, "aa": [6, 3] , "saa": [3, 2], "aship": [4, 2], "asurf": [4, 2] },
18          "A6M-G3M": { "cost": 3, "aa": [6, 3], "saa": [3, 2], "aship": [2, 1], "asurf": [4, 2] }    
19        },
20        "units": {
21          "3 Kokutai": { "type": "A6M", "loc": "PH", "hp": 2, "moveTo": "" },
22          "6 Kokutai": { "type": "A6M", "loc": "RE", "hp": 2, "moveTo": "" },
23          "Tainan Kokutai": { "type": "A6M", "loc": "NG", "hp": 2, "moveTo": "" },
24          "Yamada Kokutai": { "type": "A6M", "loc": "PH", "hp": 2, "moveTo": "" },
25          "Chitose Kokutai": { "type": "A6M-G4M", "loc": "EA", "hp": 2, "moveTo": "" },
26          "24 Sentai": { "type": "KI27", "loc": "PH", "hp": 2, "moveTo": "" },
27          "59 Sentai": { "type": "KI43", "loc": "NG", "hp": 2, "moveTo": "" },
28          "248 Sentai": { "type": "KI43", "loc": "RE", "hp": 2, "moveTo": "" },
29          "14 Sentai": { "type": "KI21", "loc": "PH", "hp": 2, "moveTo": "" },
30          "60 Sentai": { "type": "KI21", "loc": "RE", "hp": 2, "moveTo": "" },
31          "8 Sentai": { "type": "KI48", "loc": "NG", "hp": 2, "moveTo": "" },
32          "Mihoro Kokutai": { "type": "G3M", "loc": "PH", "hp": 2, "moveTo": "" },
33          "4 Kokutai": { "type": "G4M", "loc": "NG", "hp": 2, "moveTo": "" },
34          "751 Kokutai": { "type": "G4M", "loc": "RE", "hp": 2, "moveTo": "" },
35          "753 Kokutai": { "type": "G4M", "loc": "RE", "hp": 2, "moveTo": "" },
36          "Misawa Kokutai": { "type": "G4M", "loc": "RE", "hp": 2, "moveTo": "" },
37          "Takao Kokutai": { "type": "G4M", "loc": "RE", "hp": 2, "moveTo": "" },
38          "1 Kokutai": { "type": "A6M-G4M", "loc": "ML", "hp": 2, "moveTo": "" },
39          "Kanoya Kokutai": { "type": "A6M-G4M", "loc": "PH", "hp": 2, "moveTo": "" },
40          "Genzan Kokutai": { "type": "A6M-G3M", "loc": "PH", "hp": 2, "moveTo": "" }
41        }
42      },
43      "land": {
44        "units": {
45          "2-INF": { "cost": 3, "attack": [5, 3], "loc": "EA", "hp": 2, "moveTo": "" },
46          "38-INF": { "cost": 2, "attack": [4, 2], "loc": "EA", "hp": 2, "moveTo": "" },
47          "48-INF": { "cost": 3, "attack": [5, 3], "loc": "EA", "hp": 2, "moveTo": "" },
48          "6TH-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
49          "7TH-INF": { "cost": 2, "attack": [4, 2], "loc": "RE", "hp": 2, "moveTo": "" },
50          "16TH-INF": { "cost": 3, "attack": [5, 3], "loc": "PH", "hp": 2, "moveTo": "" },
51          "20TH-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
52          "35TH-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
53          "51ST-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
54          "55TH-INF": { "cost": 2, "attack": [4, 2], "loc": "NG", "hp": 2, "moveTo": "" },
55          "6TH-BASE": { "cost": 0, "attack": [2, 1], "loc": "ML", "hp": 2, "moveTo": "" },
56
57          "BN-1": { "cost": 2, "attack": [1, 0], "loc": "MA", "hp": 2, "moveTo": "" },
58          "BN-2": { "cost": 2, "attack": [1, 0], "loc": "IJ", "hp": 2, "moveTo": "" },
59          "BN-3": { "cost": 2, "attack": [1, 0], "loc": "OK", "hp": 2, "moveTo": "" },
60          "BN-4": { "cost": 2, "attack": [1, 0], "loc": "BO", "hp": 2, "moveTo": "" },
61          "BN-5": { "cost": 2, "attack": [1, 0], "loc": "GI", "hp": 2, "moveTo": "" },
62          "BN-6": { "cost": 2, "attack": [1, 0], "loc": "WI", "hp": 2, "moveTo": "" },
63          "BN-7": { "cost": 2, "attack": [1, 0], "loc": "CI", "hp": 2, "moveTo": "" },
64          "BN-8": { "cost": 2, "attack": [1, 0], "loc": "JP", "hp": 2, "moveTo": "" },
65          "BN-9": { "cost": 2, "attack": [1, 0], "loc": "JP", "hp": 2, "moveTo": "" }
66        }
67      },
68      "ships": {
69        "units": {
70          "SS1": { "type": "SS", "loc": "--", "hp": 2, "moveTo": "" },
71          "SS2": { "type": "SS", "loc": "--", "hp": 2, "moveTo": "" },
72          "SS3": { "type": "SS", "loc": "--", "hp": 2, "moveTo": "" },
73          "DD1": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
74          "DD2": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
75          "DD3": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
76          "DD4": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
77          "DD5": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
78          "DD6": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
79          "DD7": { "type": "DD", "loc": "--", "hp": 2, "moveTo": "" },
80          "AOBA-KINUGASA": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
81          "ASHIGARA-NASHI": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
82          "FURUTAKA-KAKO": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
83          "MAYA-ATAGO": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
84          "MAGOMI-MIKUMA": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
85          "MYOKO-HAGURO": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
86          "SUZUYA-KUMANO": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
87          "TAKAO-CHOKAI": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
88          "TONE-CHIKUMA": { "type": "CG", "loc": "--", "hp": 2, "moveTo": "" },
89          "YAMATO-MUSASHI": { "type": "BB-YAMATO", "loc": "--", "hp": 2, "moveTo": "" },
90          "NAGATO-MUTSU": { "type": "BB-NAGATO", "loc": "--", "hp": 2, "moveTo": "" },
91          "KONGO-HARUNA": { "type": "BB-KONGO", "loc": "--", "hp": 2, "moveTo": "" },
92          "HIEI-KIRISHIMA": { "type": "BB-KONGO", "loc": "--", "hp": 2, "moveTo": "" },
93          "FUSO-YAMASHIRO": { "type": "BB-FUSO", "loc": "--", "hp": 2, "moveTo": "" },
94          "ISE-HYUGA": { "type": "BB-FUSO", "loc": "--", "hp": 2, "moveTo": "" },
95          "AKAGI": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
96          "KAGA": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
97          "SORYU": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
98          "HIRYU": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
99          "SHOKAKU": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
100          "ZUIKAKU": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
101          "HIYO": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
102          "JUNYO": { "type": "CV", "loc": "--", "hp": 2, "moveTo": "" },
103          "HOSHO": { "type": "CVL", "loc": "--", "hp": 2, "moveTo": "" },
104          "RYUJO": { "type": "CVL", "loc": "--", "hp": 2, "moveTo": "" },
105          "SHOHO": { "type": "CVL", "loc": "--", "hp": 2, "moveTo": "" },
106          "ZUIHO": { "type": "CVL", "loc": "--", "hp": 2, "moveTo": "" },
107          "CHUYO": { "type": "CVE", "loc": "--", "hp": 2, "moveTo": "" },
108          "RYUHO": { "type": "CVE", "loc": "--", "hp": 2, "moveTo": "" },
109          "UNYO": { "type": "CVE", "loc": "--", "hp": 2, "moveTo": "" },
110          "TAIYO": { "type": "CVE", "loc": "--", "hp": 2, "moveTo": "" }             
111        },
112        "class": {
113          "SS": { "cost": 2, "aa": null, "aship": [3, 2], "asw": [1, 1], "type": "Sub" },
114          "DD": { "cost": 2, "aa": [2, 1], "aship": [3, 2], "asw": [1, 1], "type": "Surf" },
115          "CG": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [1, 1], "type": "Surf" },
116          "BB-YAMATO": { "cost": 4, "aa": [3, 2], "aship": [7, 4], "asw": [2, 1], "type": "Surf" },
117          "BB-NAGATO": { "cost": 3, "aa": [2, 1], "aship": [6, 3], "asw": [1, 1], "type": "Surf" },
118          "BB-KONGO": {"cost": 3, "aa": [3, 2], "aship": [5, 3], "asw": [1, 1], "type": "Surf" },
119          "BB-FUSO": {"cost": 3, "aa": [2, 1], "aship": [5, 3], "asw": [1, 1], "type": "Surf" },
120          "CV": { "cost": 1, "aa": [4, 2], "saa": [2, 1], "aship": null, "asw": [2, 1], "type": "Carrier" },
121          "CVL": { "cost": 1, "aa": [2, 1], "saa": [1, 0], "aship": null, "asw": [1, 1], "type": "Carrier" },
122          "CVE": { "cost": 1, "aa": [2, 1], "saa": [1, 0], "aship": null, "asw": [1, 1], "type": "Carrier" }
123        }
124      }
125    },
126    "US": {
127      "air": {
128        "types": {
129          "F4F": { "cost": 1, "aa": [5, 3], "saa": [3, 2], "aship": [1, 1], "asurf": [2, 1] },
130          "SBD": { "cost": 2, "aa": null, "saa": null, "aship": [4, 2], "asurf": [3, 2] },
131          "TBD": { "cost": 1, "aa": null, "saa": null, "aship": [3, 2], "asurf": [2, 1] },
132          "P39": { "cost": 2, "aa": [3, 2], "saa": [2, 1], "aship": [1, 1], "asurf": [3, 2] },
133          "P40": { "cost": 2, "aa": [5, 3], "saa": [3, 2], "aship": [1, 1], "asurf": [2, 1] },
134          "B17": { "cost": 1, "aa": null, "saa": null, "aship": [1, 1], "asurf": [4, 2] },
135          "B24": { "cost": 1, "aa": null, "saa": null, "aship": [1, 1], "asurf": [4, 2] },
136          "B25": { "cost": 2, "aa": null, "saa": null, "aship": [3, 2], "asurf": [3, 2] },
137          "B26": { "cost": 2, "aa": null, "saa": null, "aship": [3, 2], "asurf": [3, 2] },
138          "ANSON": { "cost": 1, "aa": null, "saa": null, "aship": [1, 1], "asurf": [2, 1] },
139          "BFIGHT": { "cost": 2, "aa": [3, 2], "saa": [2, 1], "aship": [3, 2], "asurf": [3, 2] },
140          "F4F-SBD0": { "cost": 2, "aa": [5, 3], "saa": [3, 2], "aship": [4, 2], "asurf": [3, 2] },
141          "F4F-SBD1": { "cost": 2, "aa": [3, 2], "saa": [2, 1], "aship": [4, 2], "asurf": [3, 2] },
142          "F4F-SBD2": { "cost": 2, "aa": [3, 2], "saa": [2, 1], "aship": [3, 2], "asurf": [3, 2] }
143        },
144        "units": {
145          "18-FG": { "type": "P39", "loc": "HI", "hp": 2, "moveTo": "" },
146          "RAAF-FG": { "type": "P40", "loc": "NG", "hp": 2, "moveTo": "", "cost": 1, "au": true },
147          "8-FG": { "type": "P40", "loc": "RE", "hp": 2, "moveTo": "" },
148          "49-FG": { "type": "P40", "loc": "RE", "hp": 2, "moveTo": "" },
149          "343-FG": { "type": "P40", "loc": "AK", "hp": 2, "moveTo": "" },
150          "11-BG": { "type": "B17", "loc": "HI", "hp": 2, "moveTo": "" },
151          "19-BG": { "type": "B17", "loc": "AU", "hp": 2, "moveTo": "" },
152          "28-BG": { "type": "B17", "loc": "AK", "hp": 2, "moveTo": "" },
153          "43-BG": { "type": "B17", "loc": "RE", "hp": 2, "moveTo": "" },
154          "90-BG": { "type": "B24", "loc": "RE", "hp": 2, "moveTo": "" },
155          "3-BG": { "type": "B25", "loc": "RE", "hp": 2, "moveTo": "" },
156          "38-BG": { "type": "B25", "loc": "RE", "hp": 2, "moveTo": "" },
157          "22-BG": { "type": "B26", "loc": "RE", "hp": 2, "moveTo": "" },
158          "RAAF-BG1": { "type": "ANSON", "loc": "NG", "hp": 2, "moveTo": "", "au": true },
159          "RAAF-BG2": { "type": "BFIGHT", "loc": "RE", "hp": 2, "moveTo": "", "au": true },
160          "13-MAG": { "type": "F4F-SBD0", "loc": "SA", "hp": 2, "moveTo": "" },
161          "21-MAG": { "type": "F4F-SBD0", "loc": "HI", "hp": 2, "moveTo": "" },
162          "23-MAG": { "type": "F4F-SBD1", "loc": "RE", "hp": 2, "moveTo": "" },
163          "22-MAG": { "type": "F4F-SBD2", "loc": "MI", "hp": 2, "moveTo": "" }
164        }
165      },
166      "land": {
167        "units": {
168          "1AU-INF": { "cost": 1, "attack": [4, 2], "loc": "RE", "au": true, "hp": 2, "moveTo": "" },
169            "AMERICAN-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
170            "USAFFE": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
171            "25-INF": { "cost": 1, "attack": [3, 2], "loc": "HI", "hp": 2, "moveTo": "" },
172            "32-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
173            "43-INF": { "cost": 1, "attack": [3, 2], "loc": "RE", "hp": 2, "moveTo": "" },
174            "1-MARINE": { "cost": 2, "attack": [5, 3], "loc": "RE", "marine": true, "hp": 2, "moveTo": "" },
175            "2-MARINE": { "cost": 2, "attack": [5, 3], "loc": "RE", "marine": true, "hp": 2, "moveTo": "" },
176
177            "BN-1": { "cost": 2, "attack": [1, 0], "loc": "NC", "marine": true, "hp": 2, "moveTo": "" },
178            "BN-2": { "cost": 2, "attack": [1, 0], "loc": "BO", "marine": true, "hp": 2, "moveTo": "" },
179            "BN-3": { "cost": 2, "attack": [1, 0], "loc": "SI", "marine": true, "hp": 2, "moveTo": "" },
180            "BN-4": { "cost": 2, "attack": [1, 0], "loc": "WC", "marine": true, "hp": 2, "moveTo": "" },
181            "BN-5": { "cost": 2, "attack": [1, 0], "loc": "WC", "marine": true, "hp": 2, "moveTo": "" }
182        }
183      },
184      "ships": {
185        "class": {
186          "SS": { "cost": 2, "aa": null, "aship": [2, 1], "asw": [1, 1], "type": "Sub" },
187          "DD": { "cost": 2, "aa": [3, 2], "aship": [2, 1], "asw": [3, 2], "type": "Surf" },
188          "CY-YORKTOWN": { "cost": 5, "priorityCost": 1, "aa": [4, 2], "saa": [2, 1], "aship": null, "asw": [2, 1], "type": "Carrier" },
189          "CV-WASP": { "cost": 5, "priorityCost": 1, "aa": [2, 1], "saa": [1, 0], "aship": null, "asw": [2, 1], "type": "Carrier" },
190          "CV-LEXINGTON": { "cost": 5, "priorityCost": 1, "aa": [2, 1], "saa": [1, 0], "aship": null, "asw": [2, 1], "type": "Carrier" },
191          "BB-NCAROLINA": { "cost": 4, "aa": [4, 2], "aship": [6, 3], "asw": [2, 1], "type": "Surf" },
192          "BB-SDAKOTA": { "cost": 4, "aa": [4, 2], "aship": [6, 3], "asw": [2, 1], "type": "Surf" },
193          "BB-COLORADO": { "cost": 3, "aa": [3, 2], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
194          "BB-NEWMEXICO": { "cost": 3, "aa": [3, 2], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
195          "CG-BROOKLYN": { "cost": 2, "aa": [3, 2], "aship": [3, 2], "asw": [2, 1], "type": "Surf" },
196          "CG-NORTHAMPTON": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
197          "CG-PENSACOLA": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
198          "CG-PORTLAND": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
199          "CG-NEWORLEANS": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [2, 1], "type": "Surf" },
200          "CG-ABDA": { "cost": 2, "aa": [2, 1], "aship": [4, 2], "asw": [1, 1], "type": "Surf" }
201        },
202        "units": {
203          "SS1": { "type": "SS", "loc": "HI", "hp": 2, "moveTo": "" },
204          "SS2": { "type": "SS", "loc": "P1", "hp": 2, "moveTo": "" },
205          "SS3": { "type": "SS", "loc": "AU", "hp": 2, "moveTo": "" },
206          "SS4": { "type": "SS", "loc": "P1", "hp": 2, "moveTo": "" },
207          "DD1": { "type": "DD", "loc": "HI", "hp": 2, "moveTo": "" },
208          "DD2": { "type": "DD", "loc": "WC", "hp": 2, "moveTo": "" },
209          "DD4": { "type": "DD", "loc": "P1", "hp": 2, "moveTo": "" },
210          "DD6": { "type": "DD", "loc": "HI", "hp": 2, "moveTo": "" },
211          "DD12": { "type": "DD", "loc": "P1", "hp": 2, "moveTo": "" },
212          "YORKTOWN": { "type": "CV-YORKTOWN", "loc": "P1", "hp": 2, "moveTo": "" },
213          "ENTERPRISE": { "type": "CV-YORKTOWN", "loc": "HI", "hp": 2, "moveTo": "" },
214          "HORNET": { "type": "CV-YORKTOWN", "loc": "RE", "hp": 2, "moveTo": "" },
215          "WASP": { "type": "CV-WASP", "loc": "RE", "hp": 2, "moveTo": "" },
216          "LEXINGTON": { "type": "CV-LEXINGTON", "loc": "HI", "hp": 2, "moveTo": "" },
217          "SARATOGA": { "type": "CV-LEXINGTON", "loc": "P1", "hp": 2, "moveTo": "" },
218          "NCAROLINA-WASHINGTON": { "type": "BB-NCAROLINA", "loc": "RE", "hp": 2, "moveTo": "" },
219          "SDAKOTA-INDIANA": { "type": "BB-SDAKOTA", "loc": "RE", "hp": 2, "moveTo": "" },
220          "COLORADO-MARYLAND": { "type": "BB-COLORADO", "loc": "RE", "hp": 2, "moveTo": "" },
221          "NEWMEXICO-MISSISIPI": { "type": "BB-NEWMEXICO", "loc": "RE", "hp": 2, "moveTo": "" },
222          "HONOLULU-NASHVILLE": { "type": "CG-BROOKLYN", "loc": "HI", "hp": 2, "moveTo": "" },
223          "PHOENIX-BOISE": { "type": "CG-BROOKLYN", "loc": "P1", "hp": 2, "moveTo": "" },
224          "STLOUIS-HELENA": { "type": "CG-BROOKLYN", "loc": "P1", "hp": 2, "moveTo": "" },
225
226          "CHESTER-LOUISVILLE": { "type": "CG-NORTHAMPTON", "loc": "HI", "hp": 2, "moveTo": "" },
227          "CHICAGO-NORTHAMPTON": { "type": "CG-NORTHAMPTON", "loc": "HI", "hp": 2, "moveTo": "" },
228          "PENSACOLA-SALTLAKECITY": { "type": "CG-PENSACOLA", "loc": "P1", "hp": 2, "moveTo": "" },
229          "PORTLAND-INDIANAPOLIS": { "type": "CG-PORTLAND", "loc": "P1", "hp": 2, "moveTo": "" },
230          "NEWORLEANS-MINNEAPOLIS": { "type": "CG-NEWORLEANS", "loc": "HI", "hp": 2, "moveTo": "" },
231          "SANFRANCISCO-ASTORIA": { "type": "CG-NEWORLEANS", "loc": "HI", "hp": 2, "moveTo": "" },
232          "VINCENNES-QUINCY": { "type": "CG-NEWORLEANS", "loc": "RE", "hp": 2, "moveTo": "" },
233          "ABDA": { "type": "CG-ABDA", "loc": "AU", "hp": 2, "moveTo": "" }
234        }
235      }
236    }
237  },
238  "1943": {
239  },
240  "1944": {
241  },
242  "1945": {
243  }
244}
245
246// NOSONAR
247// const forcesByArea = {
248//   JA: {
249//     HI: {
250//       air: {
251//         units: [], count: 0
252//       },
253//       land: {
254//         units: [], count: 0
255//       },
256//       sea: {
257//         units: [], count: 0
258//       },
259//       ashoreCount: 0
260//     }  
261//   }
262// }
263
264const forcesByArea = {
265}
266
267export const setForcesByArea = (year = '1942') => {
268  forcesByArea['JA'] = { }
269  forcesByArea['US'] = { }
270
271  getAreaIdList().forEach((area) => {
272    forcesByArea['JA'][area] = {
273      air: { units: [], count: 0 },
274      land: { units: [], count: 0 },
275      sea: { units: [], count: 0 },
276      ashoreCount: 0
277    }  
278    forcesByArea['US'][area] = {
279      air: { units: [], count: 0 },
280      land: { units: [], count: 0 },
281      sea: { units: [], count: 0 },
282      ashoreCount: 0
283    }  
284  })
285  
286  for (const side of forces) {
287    const forcesSide = forces[year][side]
288    for (const category of forcesSide) {
289      const forcesSideCategory = forcesSide[category]
290      for (const unit of forcesSideCategory.units) {
291
292        // unit.moveTo = '' // reset unit to not moved
293
294        const area = unit.loc
295        if (area !== '--') { // not sunk/destroyed
296          forcesByArea[side][area][categpry].units.push(unit)
297          forcesByArea[side][area][categpry].count += 1
298          if (category !== 'sea') { // not ship
299            forcesByArea[side][area].ashoreCount += 1
300          }
301        }
302      }
303    }
304  }
305}
306
307export const Scouting (year = '1942') => {
308  getAreaIdList().forEach((area) => {
309    if (forcesByArea.JA[area].ashoreCount === 1) { // if only 1 JA Ashore, set it as moved
310      const category = (forcesByArea.JA[area]['air'].count === 1) ? 'air' : 'land'
311      const unitId = forcesByArea.JA[area]['air'].units[0]
312      const unit = forces[year][side]['air'].units[unitId]
313      unit.moveTo = unit.loc
314    }
315  })
316} 
317
318export const iterateForces = (year = '1942', action = null) => {
319  for (const side of forces) {
320    const forcesSide = forces[year][side]
321    for (const category of forcesSide) {
322      const forcesSideCategory = forcesSide[category]
323      for (const unit of forcesSideCategory.units) {
324        unit.moveTo = '' // reset unit to not moved
325      }
326    }
327  }
328}
329
330// setForcesByArea
331
Full Screen

script.js

Source: script.js Github

copy
1                var canvas = document.getElementById('labirint');
2				var ctx = canvas.getContext('2d');
3				ctx.lineWidth=2;
4				ctx.strokeStyle="black";
5				//ctx.scale(1.5,1.5);
6				ctx.lineCap= "square";
7				
8				function labirint(){
9
10ctx.beginPath();
11ctx.moveTo(2,2);
12ctx.lineTo(226,2);
13
14
15
16
17
18
19
20ctx.moveTo(242,2);
21ctx.lineTo(482,2);
22
23
24
25
26
27
28
29ctx.moveTo(18,18);
30ctx.lineTo(34,18);
31
32
33
34
35
36
37
38ctx.moveTo(82,18);
39ctx.lineTo(98,18);
40
41
42
43
44
45
46
47ctx.moveTo(178,18);
48ctx.lineTo(242,18);
49
50
51
52
53
54
55
56ctx.moveTo(274,18);
57ctx.lineTo(290,18);
58
59
60
61
62
63
64
65ctx.moveTo(322,18);
66ctx.lineTo(354,18);
67
68
69
70
71
72
73
74ctx.moveTo(386,18);
75ctx.lineTo(434,18);
76
77
78
79
80
81
82
83ctx.moveTo(450,18);
84ctx.lineTo(466,18);
85
86
87
88
89
90
91
92ctx.moveTo(34,34);
93ctx.lineTo(66,34);
94
95
96
97
98
99
100
101ctx.moveTo(98,34);
102ctx.lineTo(114,34);
103
104
105
106
107
108
109
110ctx.moveTo(162,34);
111ctx.lineTo(178,34);
112
113
114
115
116
117
118
119ctx.moveTo(194,34);
120ctx.lineTo(210,34);
121
122
123
124
125
126
127
128ctx.moveTo(226,34);
129ctx.lineTo(274,34);
130
131
132
133
134
135
136
137ctx.moveTo(306,34);
138ctx.lineTo(322,34);
139
140
141
142
143
144
145
146ctx.moveTo(354,34);
147ctx.lineTo(370,34);
148
149
150
151
152
153
154
155ctx.moveTo(402,34);
156ctx.lineTo(418,34);
157
158
159
160
161
162
163
164ctx.moveTo(434,34);
165ctx.lineTo(482,34);
166
167
168
169
170
171
172
173ctx.moveTo(18,50);
174ctx.lineTo(66,50);
175
176
177
178
179
180
181
182ctx.moveTo(82,50);
183ctx.lineTo(98,50);
184
185
186
187
188
189
190
191ctx.moveTo(114,50);
192ctx.lineTo(162,50);
193
194
195
196
197
198
199
200ctx.moveTo(178,50);
201ctx.lineTo(242,50);
202
203
204
205
206
207
208
209ctx.moveTo(274,50);
210ctx.lineTo(290,50);
211
212
213
214
215
216
217
218ctx.moveTo(322,50);
219ctx.lineTo(418,50);
220
221
222
223
224
225
226
227ctx.moveTo(434,50);
228ctx.lineTo(450,50);
229
230
231
232
233
234
235
236ctx.moveTo(2,66);
237ctx.lineTo(34,66);
238
239
240
241
242
243
244
245ctx.moveTo(82,66);
246ctx.lineTo(146,66);
247
248
249
250
251
252
253
254ctx.moveTo(162,66);
255ctx.lineTo(226,66);
256
257
258
259
260
261
262
263ctx.moveTo(242,66);
264ctx.lineTo(274,66);
265
266
267
268
269
270
271
272ctx.moveTo(338,66);
273ctx.lineTo(370,66);
274
275
276
277
278
279
280
281ctx.moveTo(386,66);
282ctx.lineTo(434,66);
283
284
285
286
287
288
289
290ctx.moveTo(34,82);
291ctx.lineTo(50,82);
292
293
294
295
296
297
298
299ctx.moveTo(66,82);
300ctx.lineTo(82,82);
301
302
303
304
305
306
307
308ctx.moveTo(98,82);
309ctx.lineTo(114,82);
310
311
312
313
314
315
316
317ctx.moveTo(130,82);
318ctx.lineTo(162,82);
319
320
321
322
323
324
325
326ctx.moveTo(194,82);
327ctx.lineTo(242,82);
328
329
330
331
332
333
334
335ctx.moveTo(290,82);
336ctx.lineTo(354,82);
337
338
339
340
341
342
343
344ctx.moveTo(370,82);
345ctx.lineTo(386,82);
346
347
348
349
350
351
352
353ctx.moveTo(450,82);
354ctx.lineTo(466,82);
355
356
357
358
359
360
361
362ctx.moveTo(50,98);
363ctx.lineTo(66,98);
364
365
366
367
368
369
370
371ctx.moveTo(82,98);
372ctx.lineTo(98,98);
373
374
375
376
377
378
379
380ctx.moveTo(114,98);
381ctx.lineTo(194,98);
382
383
384
385
386
387
388
389ctx.moveTo(210,98);
390ctx.lineTo(290,98);
391
392
393
394
395
396
397
398ctx.moveTo(338,98);
399ctx.lineTo(386,98);
400
401
402
403
404
405
406
407ctx.moveTo(434,98);
408ctx.lineTo(482,98);
409
410
411
412
413
414
415
416ctx.moveTo(34,114);
417ctx.lineTo(66,114);
418
419
420
421
422
423
424
425ctx.moveTo(82,114);
426ctx.lineTo(114,114);
427
428
429
430
431
432
433
434ctx.moveTo(130,114);
435ctx.lineTo(162,114);
436
437
438
439
440
441
442
443ctx.moveTo(178,114);
444ctx.lineTo(210,114);
445
446
447
448
449
450
451
452ctx.moveTo(242,114);
453ctx.lineTo(258,114);
454
455
456
457
458
459
460
461ctx.moveTo(290,114);
462ctx.lineTo(306,114);
463
464
465
466
467
468
469
470ctx.moveTo(354,114);
471ctx.lineTo(386,114);
472
473
474
475
476
477
478
479ctx.moveTo(450,114);
480ctx.lineTo(466,114);
481
482
483
484
485
486
487
488ctx.moveTo(2,130);
489ctx.lineTo(18,130);
490
491
492
493
494
495
496
497ctx.moveTo(66,130);
498ctx.lineTo(98,130);
499
500
501
502
503
504
505
506ctx.moveTo(114,130);
507ctx.lineTo(130,130);
508
509
510
511
512
513
514
515ctx.moveTo(194,130);
516ctx.lineTo(226,130);
517
518
519
520
521
522
523
524ctx.moveTo(242,130);
525ctx.lineTo(322,130);
526
527
528
529
530
531
532
533ctx.moveTo(338,130);
534ctx.lineTo(354,130);
535
536
537
538
539
540
541
542ctx.moveTo(386,130);
543ctx.lineTo(402,130);
544
545
546
547
548
549
550
551ctx.moveTo(450,130);
552ctx.lineTo(466,130);
553
554
555
556
557
558
559
560ctx.moveTo(18,146);
561ctx.lineTo(34,146);
562
563
564
565
566
567
568
569ctx.moveTo(50,146);
570ctx.lineTo(66,146);
571
572
573
574
575
576
577
578ctx.moveTo(82,146);
579ctx.lineTo(98,146);
580
581
582
583
584
585
586
587ctx.moveTo(114,146);
588ctx.lineTo(162,146);
589
590
591
592
593
594
595
596ctx.moveTo(258,146);
597ctx.lineTo(306,146);
598
599
600
601
602
603
604
605ctx.moveTo(322,146);
606ctx.lineTo(354,146);
607
608
609
610
611
612
613
614ctx.moveTo(370,146);
615ctx.lineTo(386,146);
616
617
618
619
620
621
622
623ctx.moveTo(418,146);
624ctx.lineTo(450,146);
625
626
627
628
629
630
631
632ctx.moveTo(2,162);
633ctx.lineTo(18,162);
634
635
636
637
638
639
640
641ctx.moveTo(34,162);
642ctx.lineTo(50,162);
643
644
645
646
647
648
649
650ctx.moveTo(66,162);
651ctx.lineTo(114,162);
652
653
654
655
656
657
658
659ctx.moveTo(130,162);
660ctx.lineTo(146,162);
661
662
663
664
665
666
667
668ctx.moveTo(178,162);
669ctx.lineTo(210,162);
670
671
672
673
674
675
676
677ctx.moveTo(226,162);
678ctx.lineTo(242,162);
679
680
681
682
683
684
685
686ctx.moveTo(274,162);
687ctx.lineTo(322,162);
688
689
690
691
692
693
694
695ctx.moveTo(338,162);
696ctx.lineTo(354,162);
697
698
699
700
701
702
703
704ctx.moveTo(402,162);
705ctx.lineTo(466,162);
706
707
708
709
710
711
712
713ctx.moveTo(82,178);
714ctx.lineTo(98,178);
715
716
717
718
719
720
721
722ctx.moveTo(114,178);
723ctx.lineTo(130,178);
724
725
726
727
728
729
730
731ctx.moveTo(194,178);
732ctx.lineTo(226,178);
733
734
735
736
737
738
739
740ctx.moveTo(242,178);
741ctx.lineTo(306,178);
742
743
744
745
746
747
748
749ctx.moveTo(322,178);
750ctx.lineTo(338,178);
751
752
753
754
755
756
757
758ctx.moveTo(354,178);
759ctx.lineTo(450,178);
760
761
762
763
764
765
766
767ctx.moveTo(2,194);
768ctx.lineTo(18,194);
769
770
771
772
773
774
775
776ctx.moveTo(66,194);
777ctx.lineTo(82,194);
778
779
780
781
782
783
784
785ctx.moveTo(98,194);
786ctx.lineTo(114,194);
787
788
789
790
791
792
793
794ctx.moveTo(162,194);
795ctx.lineTo(178,194);
796
797
798
799
800
801
802
803ctx.moveTo(258,194);
804ctx.lineTo(274,194);
805
806
807
808
809
810
811
812ctx.moveTo(306,194);
813ctx.lineTo(338,194);
814
815
816
817
818
819
820
821ctx.moveTo(354,194);
822ctx.lineTo(370,194);
823
824
825
826
827
828
829
830ctx.moveTo(402,194);
831ctx.lineTo(434,194);
832
833
834
835
836
837
838
839ctx.moveTo(450,194);
840ctx.lineTo(482,194);
841
842
843
844
845
846
847
848ctx.moveTo(82,210);
849ctx.lineTo(98,210);
850
851
852
853
854
855
856
857ctx.moveTo(114,210);
858ctx.lineTo(130,210);
859
860
861
862
863
864
865
866ctx.moveTo(146,210);
867ctx.lineTo(162,210);
868
869
870
871
872
873
874
875ctx.moveTo(210,210);
876ctx.lineTo(274,210);
877
878
879
880
881
882
883
884ctx.moveTo(290,210);
885ctx.lineTo(306,210);
886
887
888
889
890
891
892
893ctx.moveTo(370,210);
894ctx.lineTo(402,210);
895
896
897
898
899
900
901
902ctx.moveTo(434,210);
903ctx.lineTo(450,210);
904
905
906
907
908
909
910
911ctx.moveTo(34,226);
912ctx.lineTo(82,226);
913
914
915
916
917
918
919
920ctx.moveTo(98,226);
921ctx.lineTo(130,226);
922
923
924
925
926
927
928
929ctx.moveTo(162,226);
930ctx.lineTo(178,226);
931
932
933
934
935
936
937
938ctx.moveTo(258,226);
939ctx.lineTo(290,226);
940
941
942
943
944
945
946
947ctx.moveTo(306,226);
948ctx.lineTo(370,226);
949
950
951
952
953
954
955
956ctx.moveTo(402,226);
957ctx.lineTo(466,226);
958
959
960
961
962
963
964
965ctx.moveTo(34,242);
966ctx.lineTo(82,242);
967
968
969
970
971
972
973
974ctx.moveTo(146,242);
975ctx.lineTo(162,242);
976
977
978
979
980
981
982
983ctx.moveTo(178,242);
984ctx.lineTo(210,242);
985
986
987
988
989
990
991
992ctx.moveTo(226,242);
993ctx.lineTo(274,242);
994
995
996
997
998
999
1000
1001ctx.moveTo(290,242);
1002ctx.lineTo(306,242);
1003
1004
1005
1006
1007
1008
1009
1010ctx.moveTo(338,242);
1011ctx.lineTo(418,242);
1012
1013
1014
1015
1016
1017
1018
1019ctx.moveTo(450,242);
1020ctx.lineTo(482,242);
1021
1022
1023
1024
1025
1026
1027
1028ctx.moveTo(50,258);
1029ctx.lineTo(66,258);
1030
1031
1032
1033
1034
1035
1036
1037ctx.moveTo(82,258);
1038ctx.lineTo(98,258);
1039
1040
1041
1042
1043
1044
1045
1046ctx.moveTo(130,258);
1047ctx.lineTo(146,258);
1048
1049
1050
1051
1052
1053
1054
1055ctx.moveTo(162,258);
1056ctx.lineTo(178,258);
1057
1058
1059
1060
1061
1062
1063
1064ctx.moveTo(194,258);
1065ctx.lineTo(242,258);
1066
1067
1068
1069
1070
1071
1072
1073ctx.moveTo(258,258);
1074ctx.lineTo(322,258);
1075
1076
1077
1078
1079
1080
1081
1082ctx.moveTo(386,258);
1083ctx.lineTo(402,258);
1084
1085
1086
1087
1088
1089
1090
1091ctx.moveTo(418,258);
1092ctx.lineTo(434,258);
1093
1094
1095
1096
1097
1098
1099
1100ctx.moveTo(450,258);
1101ctx.lineTo(466,258);
1102
1103
1104
1105
1106
1107
1108
1109ctx.moveTo(2,274);
1110ctx.lineTo(34,274);
1111
1112
1113
1114
1115
1116
1117
1118ctx.moveTo(50,274);
1119ctx.lineTo(66,274);
1120
1121
1122
1123
1124
1125
1126
1127ctx.moveTo(130,274);
1128ctx.lineTo(162,274);
1129
1130
1131
1132
1133
1134
1135
1136ctx.moveTo(210,274);
1137ctx.lineTo(242,274);
1138
1139
1140
1141
1142
1143
1144
1145ctx.moveTo(274,274);
1146ctx.lineTo(290,274);
1147
1148
1149
1150
1151
1152
1153
1154ctx.moveTo(322,274);
1155ctx.lineTo(338,274);
1156
1157
1158
1159
1160
1161
1162
1163ctx.moveTo(386,274);
1164ctx.lineTo(418,274);
1165
1166
1167
1168
1169
1170
1171
1172ctx.moveTo(434,274);
1173ctx.lineTo(450,274);
1174
1175
1176
1177
1178
1179
1180
1181ctx.moveTo(34,290);
1182ctx.lineTo(50,290);
1183
1184
1185
1186
1187
1188
1189
1190ctx.moveTo(82,290);
1191ctx.lineTo(178,290);
1192
1193
1194
1195
1196
1197
1198
1199ctx.moveTo(194,290);
1200ctx.lineTo(226,290);
1201
1202
1203
1204
1205
1206
1207
1208ctx.moveTo(258,290);
1209ctx.lineTo(274,290);
1210
1211
1212
1213
1214
1215
1216
1217ctx.moveTo(370,290);
1218ctx.lineTo(386,290);
1219
1220
1221
1222
1223
1224
1225
1226ctx.moveTo(402,290);
1227ctx.lineTo(466,290);
1228
1229
1230
1231
1232
1233
1234
1235ctx.moveTo(2,306);
1236ctx.lineTo(18,306);
1237
1238
1239
1240
1241
1242
1243
1244ctx.moveTo(34,306);
1245ctx.lineTo(130,306);
1246
1247
1248
1249
1250
1251
1252
1253ctx.moveTo(146,306);
1254ctx.lineTo(162,306);
1255
1256
1257
1258
1259
1260
1261
1262ctx.moveTo(178,306);
1263ctx.lineTo(194,306);
1264
1265
1266
1267
1268
1269
1270
1271ctx.moveTo(210,306);
1272ctx.lineTo(258,306);
1273
1274
1275
1276
1277
1278
1279
1280ctx.moveTo(274,306);
1281ctx.lineTo(290,306);
1282
1283
1284
1285
1286
1287
1288
1289ctx.moveTo(322,306);
1290ctx.lineTo(338,306);
1291
1292
1293
1294
1295
1296
1297
1298ctx.moveTo(370,306);
1299ctx.lineTo(418,306);
1300
1301
1302
1303
1304
1305
1306
1307ctx.moveTo(450,306);
1308ctx.lineTo(482,306);
1309
1310
1311
1312
1313
1314
1315
1316ctx.moveTo(18,322);
1317ctx.lineTo(34,322);
1318
1319
1320
1321
1322
1323
1324
1325ctx.moveTo(82,322);
1326ctx.lineTo(98,322);
1327
1328
1329
1330
1331
1332
1333
1334ctx.moveTo(130,322);
1335ctx.lineTo(146,322);
1336
1337
1338
1339
1340
1341
1342
1343ctx.moveTo(178,322);
1344ctx.lineTo(194,322);
1345
1346
1347
1348
1349
1350
1351
1352ctx.moveTo(258,322);
1353ctx.lineTo(274,322);
1354
1355
1356
1357
1358
1359
1360
1361ctx.moveTo(306,322);
1362ctx.lineTo(322,322);
1363
1364
1365
1366
1367
1368
1369
1370ctx.moveTo(386,322);
1371ctx.lineTo(402,322);
1372
1373
1374
1375
1376
1377
1378
1379ctx.moveTo(434,322);
1380ctx.lineTo(466,322);
1381
1382
1383
1384
1385
1386
1387
1388ctx.moveTo(50,338);
1389ctx.lineTo(66,338);
1390
1391
1392
1393
1394
1395
1396
1397ctx.moveTo(114,338);
1398ctx.lineTo(130,338);
1399
1400
1401
1402
1403
1404
1405
1406ctx.moveTo(162,338);
1407ctx.lineTo(226,338);
1408
1409
1410
1411
1412
1413
1414
1415ctx.moveTo(242,338);
1416ctx.lineTo(258,338);
1417
1418
1419
1420
1421
1422
1423
1424ctx.moveTo(274,338);
1425ctx.lineTo(322,338);
1426
1427
1428
1429
1430
1431
1432
1433ctx.moveTo(402,338);
1434ctx.lineTo(418,338);
1435
1436
1437
1438
1439
1440
1441
1442ctx.moveTo(450,338);
1443ctx.lineTo(466,338);
1444
1445
1446
1447
1448
1449
1450
1451ctx.moveTo(18,354);
1452ctx.lineTo(34,354);
1453
1454
1455
1456
1457
1458
1459
1460ctx.moveTo(66,354);
1461ctx.lineTo(82,354);
1462
1463
1464
1465
1466
1467
1468
1469ctx.moveTo(98,354);
1470ctx.lineTo(114,354);
1471
1472
1473
1474
1475
1476
1477
1478ctx.moveTo(306,354);
1479ctx.lineTo(338,354);
1480
1481
1482
1483
1484
1485
1486
1487ctx.moveTo(354,354);
1488ctx.lineTo(386,354);
1489
1490
1491
1492
1493
1494
1495
1496ctx.moveTo(418,354);
1497ctx.lineTo(434,354);
1498
1499
1500
1501
1502
1503
1504
1505ctx.moveTo(34,370);
1506ctx.lineTo(50,370);
1507
1508
1509
1510
1511
1512
1513
1514ctx.moveTo(114,370);
1515ctx.lineTo(162,370);
1516
1517
1518
1519
1520
1521
1522
1523ctx.moveTo(194,370);
1524ctx.lineTo(226,370);
1525
1526
1527
1528
1529
1530
1531
1532ctx.moveTo(290,370);
1533ctx.lineTo(306,370);
1534
1535
1536
1537
1538
1539
1540
1541ctx.moveTo(338,370);
1542ctx.lineTo(354,370);
1543
1544
1545
1546
1547
1548
1549
1550ctx.moveTo(386,370);
1551ctx.lineTo(402,370);
1552
1553
1554
1555
1556
1557
1558
1559ctx.moveTo(434,370);
1560ctx.lineTo(450,370);
1561
1562
1563
1564
1565
1566
1567
1568ctx.moveTo(466,370);
1569ctx.lineTo(482,370);
1570
1571
1572
1573
1574
1575
1576
1577ctx.moveTo(2,386);
1578ctx.lineTo(34,386);
1579
1580
1581
1582
1583
1584
1585
1586ctx.moveTo(130,386);
1587ctx.lineTo(146,386);
1588
1589
1590
1591
1592
1593
1594
1595ctx.moveTo(162,386);
1596ctx.lineTo(178,386);
1597
1598
1599
1600
1601
1602
1603
1604ctx.moveTo(210,386);
1605ctx.lineTo(226,386);
1606
1607
1608
1609
1610
1611
1612
1613ctx.moveTo(242,386);
1614ctx.lineTo(322,386);
1615
1616
1617
1618
1619
1620
1621
1622ctx.moveTo(402,386);
1623ctx.lineTo(418,386);
1624
1625
1626
1627
1628
1629
1630
1631ctx.moveTo(450,386);
1632ctx.lineTo(466,386);
1633
1634
1635
1636
1637
1638
1639
1640ctx.moveTo(18,402);
1641ctx.lineTo(34,402);
1642
1643
1644
1645
1646
1647
1648
1649ctx.moveTo(114,402);
1650ctx.lineTo(130,402);
1651
1652
1653
1654
1655
1656
1657
1658ctx.moveTo(146,402);
1659ctx.lineTo(162,402);
1660
1661
1662
1663
1664
1665
1666
1667ctx.moveTo(370,402);
1668ctx.lineTo(418,402);
1669
1670
1671
1672
1673
1674
1675
1676ctx.moveTo(434,402);
1677ctx.lineTo(466,402);
1678
1679
1680
1681
1682
1683
1684
1685ctx.moveTo(2,418);
1686ctx.lineTo(18,418);
1687
1688
1689
1690
1691
1692
1693
1694ctx.moveTo(50,418);
1695ctx.lineTo(82,418);
1696
1697
1698
1699
1700
1701
1702
1703ctx.moveTo(98,418);
1704ctx.lineTo(146,418);
1705
1706
1707
1708
1709
1710
1711
1712ctx.moveTo(210,418);
1713ctx.lineTo(258,418);
1714
1715
1716
1717
1718
1719
1720
1721ctx.moveTo(274,418);
1722ctx.lineTo(402,418);
1723
1724
1725
1726
1727
1728
1729
1730ctx.moveTo(418,418);
1731ctx.lineTo(434,418);
1732
1733
1734
1735
1736
1737
1738
1739ctx.moveTo(450,418);
1740ctx.lineTo(482,418);
1741
1742
1743
1744
1745
1746
1747
1748ctx.moveTo(18,434);
1749ctx.lineTo(50,434);
1750
1751
1752
1753
1754
1755
1756
1757ctx.moveTo(178,434);
1758ctx.lineTo(210,434);
1759
1760
1761
1762
1763
1764
1765
1766ctx.moveTo(226,434);
1767ctx.lineTo(274,434);
1768
1769
1770
1771
1772
1773
1774
1775ctx.moveTo(322,434);
1776ctx.lineTo(354,434);
1777
1778
1779
1780
1781
1782
1783
1784ctx.moveTo(386,434);
1785ctx.lineTo(466,434);
1786
1787
1788
1789
1790
1791
1792
1793ctx.moveTo(2,450);
1794ctx.lineTo(18,450);
1795
1796
1797
1798
1799
1800
1801
1802ctx.moveTo(50,450);
1803ctx.lineTo(130,450);
1804
1805
1806
1807
1808
1809
1810
1811ctx.moveTo(162,450);
1812ctx.lineTo(194,450);
1813
1814
1815
1816
1817
1818
1819
1820ctx.moveTo(306,450);
1821ctx.lineTo(322,450);
1822
1823
1824
1825
1826
1827
1828
1829ctx.moveTo(338,450);
1830ctx.lineTo(370,450);
1831
1832
1833
1834
1835
1836
1837
1838ctx.moveTo(434,450);
1839ctx.lineTo(482,450);
1840
1841
1842
1843
1844
1845
1846
1847ctx.moveTo(98,466);
1848ctx.lineTo(114,466);
1849
1850
1851
1852
1853
1854
1855
1856ctx.moveTo(130,466);
1857ctx.lineTo(146,466);
1858
1859
1860
1861
1862
1863
1864
1865ctx.moveTo(194,466);
1866ctx.lineTo(258,466);
1867
1868
1869
1870
1871
1872
1873
1874ctx.moveTo(274,466);
1875ctx.lineTo(306,466);
1876
1877
1878
1879
1880
1881
1882
1883ctx.moveTo(354,466);
1884ctx.lineTo(402,466);
1885
1886
1887
1888
1889
1890
1891
1892ctx.moveTo(2,482);
1893ctx.lineTo(242,482);
1894
1895
1896
1897
1898
1899
1900
1901ctx.moveTo(258,482);
1902ctx.lineTo(482,482);
1903
1904
1905
1906
1907
1908
1909
1910ctx.moveTo(2,2);
1911ctx.lineTo(2,482);
1912
1913
1914
1915
1916
1917
1918
1919ctx.moveTo(18,18);
1920ctx.lineTo(18,50);
1921
1922
1923
1924
1925
1926
1927
1928ctx.moveTo(18,66);
1929ctx.lineTo(18,98);
1930
1931
1932
1933
1934
1935
1936
1937ctx.moveTo(18,114);
1938ctx.lineTo(18,130);
1939
1940
1941
1942
1943
1944
1945
1946ctx.moveTo(18,162);
1947ctx.lineTo(18,178);
1948
1949
1950
1951
1952
1953
1954
1955ctx.moveTo(18,194);
1956ctx.lineTo(18,258);
1957
1958
1959
1960
1961
1962
1963
1964ctx.moveTo(18,290);
1965ctx.lineTo(18,306);
1966
1967
1968
1969
1970
1971
1972
1973ctx.moveTo(18,338);
1974ctx.lineTo(18,370);
1975
1976
1977
1978
1979
1980
1981
1982ctx.moveTo(18,418);
1983ctx.lineTo(18,434);
1984
1985
1986
1987
1988
1989
1990
1991ctx.moveTo(18,466);
1992ctx.lineTo(18,482);
1993
1994
1995
1996
1997
1998
1999
2000ctx.moveTo(34,82);
2001ctx.lineTo(34,210);
2002
2003
2004
2005
2006
2007
2008
2009ctx.moveTo(34,242);
2010ctx.lineTo(34,290);
2011
2012
2013
2014
2015
2016
2017
2018ctx.moveTo(34,306);
2019ctx.lineTo(34,354);
2020
2021
2022
2023
2024
2025
2026
2027ctx.moveTo(34,370);
2028ctx.lineTo(34,418);
2029
2030
2031
2032
2033
2034
2035
2036ctx.moveTo(34,434);
2037ctx.lineTo(34,466);
2038
2039
2040
2041
2042
2043
2044
2045ctx.moveTo(50,2);
2046ctx.lineTo(50,18);
2047
2048
2049
2050
2051
2052
2053
2054ctx.moveTo(50,50);
2055ctx.lineTo(50,82);
2056
2057
2058
2059
2060
2061
2062
2063ctx.moveTo(50,130);
2064ctx.lineTo(50,146);
2065
2066
2067
2068
2069
2070
2071
2072ctx.moveTo(50,162);
2073ctx.lineTo(50,226);
2074
2075
2076
2077
2078
2079
2080
2081ctx.moveTo(50,274);
2082ctx.lineTo(50,290);
2083
2084
2085
2086
2087
2088
2089
2090ctx.moveTo(50,322);
2091ctx.lineTo(50,338);
2092
2093
2094
2095
2096
2097
2098
2099ctx.moveTo(50,354);
2100ctx.lineTo(50,402);
2101
2102
2103
2104
2105
2106
2107
2108ctx.moveTo(50,418);
2109ctx.lineTo(50,434);
2110
2111
2112
2113
2114
2115
2116
2117ctx.moveTo(50,450);
2118ctx.lineTo(50,466);
2119
2120
2121
2122
2123
2124
2125
2126ctx.moveTo(66,2);
2127ctx.lineTo(66,34);
2128
2129
2130
2131
2132
2133
2134
2135ctx.moveTo(66,50);
2136ctx.lineTo(66,98);
2137
2138
2139
2140
2141
2142
2143
2144ctx.moveTo(66,114);
2145ctx.lineTo(66,130);
2146
2147
2148
2149
2150
2151
2152
2153ctx.moveTo(66,146);
2154ctx.lineTo(66,210);
2155
2156
2157
2158
2159
2160
2161
2162ctx.moveTo(66,258);
2163ctx.lineTo(66,274);
2164
2165
2166
2167
2168
2169
2170
2171ctx.moveTo(66,290);
2172ctx.lineTo(66,338);
2173
2174
2175
2176
2177
2178
2179
2180ctx.moveTo(66,354);
2181ctx.lineTo(66,402);
2182
2183
2184
2185
2186
2187
2188
2189ctx.moveTo(66,434);
2190ctx.lineTo(66,450);
2191
2192
2193
2194
2195
2196
2197
2198ctx.moveTo(66,466);
2199ctx.lineTo(66,482);
2200
2201
2202
2203
2204
2205
2206
2207ctx.moveTo(82,34);
2208ctx.lineTo(82,50);
2209
2210
2211
2212
2213
2214
2215
2216ctx.moveTo(82,66);
2217ctx.lineTo(82,82);
2218
2219
2220
2221
2222
2223
2224
2225ctx.moveTo(82,98);
2226ctx.lineTo(82,114);
2227
2228
2229
2230
2231
2232
2233
2234ctx.moveTo(82,130);
2235ctx.lineTo(82,146);
2236
2237
2238
2239
2240
2241
2242
2243ctx.moveTo(82,210);
2244ctx.lineTo(82,258);
2245
2246
2247
2248
2249
2250
2251
2252ctx.moveTo(82,274);
2253ctx.lineTo(82,290);
2254
2255
2256
2257
2258
2259
2260
2261ctx.moveTo(82,322);
2262ctx.lineTo(82,354);
2263
2264
2265
2266
2267
2268
2269
2270ctx.moveTo(82,370);
2271ctx.lineTo(82,434);
2272
2273
2274
2275
2276
2277
2278
2279ctx.moveTo(82,450);
2280ctx.lineTo(82,466);
2281
2282
2283
2284
2285
2286
2287
2288ctx.moveTo(98,18);
2289ctx.lineTo(98,34);
2290
2291
2292
2293
2294
2295
2296
2297ctx.moveTo(98,50);
2298ctx.lineTo(98,66);
2299
2300
2301
2302
2303
2304
2305
2306ctx.moveTo(98,178);
2307ctx.lineTo(98,210);
2308
2309
2310
2311
2312
2313
2314
2315ctx.moveTo(98,226);
2316ctx.lineTo(98,274);
2317
2318
2319
2320
2321
2322
2323
2324ctx.moveTo(98,322);
2325ctx.lineTo(98,450);
2326
2327
2328
2329
2330
2331
2332
2333ctx.moveTo(98,466);
2334ctx.lineTo(98,482);
2335
2336
2337
2338
2339
2340
2341
2342ctx.moveTo(114,2);
2343ctx.lineTo(114,18);
2344
2345
2346
2347
2348
2349
2350
2351ctx.moveTo(114,34);
2352ctx.lineTo(114,50);
2353
2354
2355
2356
2357
2358
2359
2360ctx.moveTo(114,82);
2361ctx.lineTo(114,114);
2362
2363
2364
2365
2366
2367
2368
2369ctx.moveTo(114,146);
2370ctx.lineTo(114,178);
2371
2372
2373
2374
2375
2376
2377
2378ctx.moveTo(114,242);
2379ctx.lineTo(114,290);
2380
2381
2382
2383
2384
2385
2386
2387ctx.moveTo(114,306);
2388ctx.lineTo(114,338);
2389
2390
2391
2392
2393
2394
2395
2396ctx.moveTo(114,370);
2397ctx.lineTo(114,402);
2398
2399
2400
2401
2402
2403
2404
2405ctx.moveTo(114,418);
2406ctx.lineTo(114,434);
2407
2408
2409
2410
2411
2412
2413
2414ctx.moveTo(130,2);
2415ctx.lineTo(130,34);
2416
2417
2418
2419
2420
2421
2422
2423ctx.moveTo(130,66);
2424ctx.lineTo(130,82);
2425
2426
2427
2428
2429
2430
2431
2432ctx.moveTo(130,114);
2433ctx.lineTo(130,130);
2434
2435
2436
2437
2438
2439
2440
2441ctx.moveTo(130,178);
2442ctx.lineTo(130,274);
2443
2444
2445
2446
2447
2448
2449
2450ctx.moveTo(130,306);
2451ctx.lineTo(130,322);
2452
2453
2454
2455
2456
2457
2458
2459ctx.moveTo(130,338);
2460ctx.lineTo(130,370);
2461
2462
2463
2464
2465
2466
2467
2468ctx.moveTo(130,434);
2469ctx.lineTo(130,466);
2470
2471
2472
2473
2474
2475
2476
2477ctx.moveTo(146,18);
2478ctx.lineTo(146,50);
2479
2480
2481
2482
2483
2484
2485
2486ctx.moveTo(146,130);
2487ctx.lineTo(146,146);
2488
2489
2490
2491
2492
2493
2494
2495ctx.moveTo(146,162);
2496ctx.lineTo(146,210);
2497
2498
2499
2500
2501
2502
2503