Skip to content

Instantly share code, notes, and snippets.

@sjehutch
Created October 26, 2017 04:23
Show Gist options
  • Save sjehutch/d81e535baa1c28639611d372e33df8b1 to your computer and use it in GitHub Desktop.
Save sjehutch/d81e535baa1c28639611d372e33df8b1 to your computer and use it in GitHub Desktop.
//: Playground - noun: a place where people can play
import UIKit
var basic_premiuma = [
[10000, 10000, 238],
[10001, 10500, 242],
[10501, 11000, 244],
[11001, 11500, 248],
[11501, 12000, 252],
[12001, 12500, 255],
[12501, 13000, 260],
[13001, 13500, 264],
[13501, 14000, 267],
[14001, 14500, 270],
[14501, 15000, 272],
[15001, 15500, 276],
[15501, 16000, 280],
[16001, 16500, 284],
[16501, 17000, 287],
[17001, 17500, 292],
[17501, 18000, 296],
[18001, 18500, 298],
[18501, 19000, 301],
[19001, 19500, 304],
[19501, 20000, 309],
[20001, 20500, 312],
[20501, 21000, 317],
[21001, 21500, 320],
[21501, 22000, 324],
[22001, 22500, 327],
[22501, 23000, 330],
[23001, 23500, 333],
[23501, 24000, 337],
[24001, 24500, 340],
[24501, 25000, 345],
[25001, 25500, 348],
[25501, 26000, 352],
[26001, 26500, 355],
[26501, 27000, 358],
[27001, 27500, 361],
[27501, 28000, 365],
[28001, 28500, 368],
[28501, 29000, 373],
[29001, 29500, 376],
[29501, 30000, 380],
[30001, 30500, 383],
[30501, 31000, 387],
[31001, 31500, 390],
[31501, 32000, 393],
[32001, 32500, 398],
[32501, 33000, 401],
[33001, 33500, 405],
[33501, 34000, 408],
[34001, 34500, 412],
[34501, 35000, 415],
[35001, 35500, 419],
[35501, 36000, 422],
[36001, 36500, 426],
[36501, 37000, 429],
[37001, 37500, 433],
[37501, 38000, 437],
[38001, 38500, 441],
[38501, 39000, 443],
[39001, 39500, 447],
[39501, 40000, 450],
[40001, 40500, 455],
[40501, 41000, 457],
[41001, 41500, 462],
[41501, 42000, 465],
[42001, 42500, 469],
[42501, 43000, 471],
[43001, 43500, 475],
[43501, 44000, 479],
[44001, 44500, 483],
[44501, 45000, 487],
[45001, 45500, 490],
[45501, 46000, 493],
[46001, 46500, 497],
[46501, 47000, 499],
[47001, 47500, 503],
[47501, 48000, 508],
[48001, 48500, 512],
[48501, 49000, 515],
[49001, 49500, 518],
[49501, 50000, 522],
[50001, 50500, 525],
[50501, 51000, 527],
[51001, 51500, 531],
[51501, 52000, 536],
[52001, 52500, 540],
[52501, 53000, 543],
[53001, 53500, 547],
[53501, 54000, 550],
[54001, 54500, 553],
[54501, 55000, 556],
[55001, 55500, 559],
[55501, 56000, 565],
[56001, 56500, 568],
[56501, 57000, 571],
[57001, 57500, 575],
[57501, 58000, 579],
[58001, 58500, 581],
[58501, 59000, 585],
[59001, 59500, 589],
[59501, 60000, 593],
[60001, 60500, 597],
[60501, 61000, 600],
[61001, 61500, 603],
[61501, 62000, 607],
[62001, 62500, 611],
[62501, 63000, 613],
[63001, 63500, 617],
[63501, 64000, 621],
[64001, 64500, 625],
[64501, 65000, 628],
[65001, 65500, 631],
[65501, 66000, 635],
[66001, 66500, 640],
[66501, 67000, 644],
[67001, 67500, 645],
[67501, 68000, 649],
[68001, 68500, 653],
[68501, 69000, 656],
[69001, 69500, 659],
[69501, 70000, 664],
[70001, 70500, 668],
[70501, 71000, 672],
[71001, 71500, 674],
[71501, 72000, 677],
[72001, 72500, 681],
[72501, 73000, 685],
[73001, 73500, 688],
[73501, 74000, 692],
[74001, 74500, 696],
[74501, 75000, 700],
[75001, 75500, 702],
[75501, 76000, 706],
[76001, 76500, 709],
[76501, 77000, 713],
[77001, 77500, 716],
[77501, 78000, 720],
[78001, 78500, 725],
[78501, 79000, 729],
[79001, 79500, 730],
[79501, 80000, 734],
[80001, 80500, 738],
[80501, 81000, 742],
[81001, 81500, 744],
[81501, 82000, 748],
[82001, 82500, 753],
[82501, 83000, 757],
[83001, 83500, 759],
[83501, 84000, 762],
[84001, 84500, 767],
[84501, 85000, 770],
[85001, 85500, 773],
[85501, 86000, 776],
[86001, 86500, 781],
[86501, 87000, 785],
[87001, 87500, 788],
[87501, 88000, 791],
[88001, 88500, 795],
[88501, 89000, 799],
[89001, 89500, 801],
[89501, 90000, 804],
[90001, 90500, 809],
[90501, 91000, 813],
[91001, 91500, 817],
[91501, 92000, 819],
[92001, 92500, 823],
[92501, 93000, 827],
[93001, 93500, 831],
[93501, 94000, 832],
[94001, 94500, 837],
[94501, 95000, 842],
[95001, 95500, 845],
[95501, 96000, 847],
[96001, 96500, 851],
[96501, 97000, 855],
[97001, 97500, 859],
[97501, 98000, 862],
[98001, 98500, 866],
[98501, 99000, 870],
[99001, 99500, 873],
[99501, 100000, 875]
]
let start = 100000
let end = 100000
if let index = basic_premiuma.index(where: { $0[0] >= start }) {
print(basic_premiuma[index].last ?? "nil")
}
//Can you show me a function where i can pass in 10000 , 10000 and get the value 238 OR
//10001 , 10500 and get the valie 242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment