Михаил Капелько 9 months ago
parent
commit
5db321b691
4 changed files with 18 additions and 19 deletions
  1. +0
    -14
      Swift/Memory.Aux.swift
  2. +0
    -1
      Swift/main.swift
  3. +1
    -4
      gen-Swift
  4. +17
    -0
      main.swift

+ 0
- 14
Swift/Memory.Aux.swift View File

@@ -1,14 +0,0 @@
func memory_generateConstPlayfield(
_ n: Int
) -> [Int: Int] {
var idGroups = [Int: Int]()
var id = 0
for gid in stride(from: 0, to: n, by: 1) {
idGroups[id] = gid
id += 1
idGroups[id] = gid
id += 1
}

return idGroups
}

+ 0
- 1
Swift/main.swift View File

@@ -1 +0,0 @@
print(test_memory_generateConstPlayfield())

+ 1
- 4
gen-Swift View File

@@ -1,4 +1 @@
swiftc -o test_memory_Swift \
Swift/Memory.Aux.swift \
Swift/Memory.Test.swift \
Swift/main.swift
swiftc -o test_memory_Swift main.swift

Swift/Memory.Test.swift → main.swift View File

@@ -1,3 +1,18 @@
func memory_generateConstPlayfield(
_ n: Int
) -> [Int: Int] {
var idGroups = [Int: Int]()
var id = 0
for gid in stride(from: 0, to: n, by: 1) {
idGroups[id] = gid
id += 1
idGroups[id] = gid
id += 1
}

return idGroups
}

func test_memory_generateConstPlayfield() -> String { func test_memory_generateConstPlayfield() -> String {
let idGroups = memory_generateConstPlayfield(2) let idGroups = memory_generateConstPlayfield(2)
if ( if (
@@ -12,3 +27,5 @@ func test_memory_generateConstPlayfield() -> String {


return "ERR: memory_generateConstPlayfield" return "ERR: memory_generateConstPlayfield"
} }

print(test_memory_generateConstPlayfield())

Loading…
Cancel
Save