Михаил Капелько 11 months ago
parent
commit
5efa5aece4
4 changed files with 0 additions and 36 deletions
  1. +0
    -4
      shared/Swift/memoryGap.swift
  2. +0
    -26
      shared/Swift/memoryItemPositions.swift
  3. +0
    -3
      shared/Swift/memorySide.swift
  4. +0
    -3
      shared/Swift/memorySpace.swift

+ 0
- 4
shared/Swift/memoryGap.swift View File

@@ -1,4 +0,0 @@
// @ts-nocheck
func memoryGap() -> Float {
return memorySide() + memorySpace()
}

+ 0
- 26
shared/Swift/memoryItemPositions.swift View File

@@ -1,26 +0,0 @@
import "./memoryGap.js"
protocol Context {
var itemsCount: Float { get }
}
class Position {
x: Float
y: Float
constructor(x, y) {
this.x = x
this.y = y
}
}
func memoryItemPositions(c: Context) -> Position[] {
var pos: Position[] = []
for (var i = 0; i < c.itemsCount; i++) {
let row = Math.floor(i / 4)
let x = memoryGap() + (i - row * 4) * memoryGap()
let y = memoryGap() + row * memoryGap()
pos.push(new Position(x, y))
}
return pos
}

+ 0
- 3
shared/Swift/memorySide.swift View File

@@ -1,3 +0,0 @@
func memorySide() -> Float {
return 50
}

+ 0
- 3
shared/Swift/memorySpace.swift View File

@@ -1,3 +0,0 @@
func memorySpace() -> Float {
return 20
}

Loading…
Cancel
Save