• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16function frame_states(n : number) {
17  let perm1: Int32Array = new Int32Array(n);
18  let i: number = 0;
19  let j: number = 0;
20      // Use incremental change to generate another permutation
21  while (i < 1 && j < 1) {
22    i = 0;
23    j = 0;
24    while (i < n && j < n) {
25        perm1[i] = 0;
26        perm1[j] = 0;
27        i = i + 1;
28        j = j + 1;
29    }
30    while (i < n) {
31        perm1[i] = 0;
32        i = i + 1;
33    }
34    while (j < n) {
35        perm1[j] = 0;
36        j = j + 1;
37    }
38    while (i < n && j < n) {
39      perm1[i] = 0;
40      perm1[j] = 0;
41      i = i + 1;
42      j = j + 1;
43    }
44  }
45}
46
47frame_states(10);