This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PriorityQueue<T> | |
{ | |
readonly SortedDictionary<T, int> dict; | |
public PriorityQueue() | |
{ | |
dict = new SortedDictionary<T, int>(); | |
} | |
public PriorityQueue(IComparer<T> comparer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns walk-tutorial.core | |
(:require [clojure.pprint :as p] | |
[clojure.walk :as w])) | |
; estamos recebendo como input um mapa com strings ao invés de symbols | |
; como chaves | |
(def tree-map {"a" {"b" {"d" 4 | |
"e" 5} | |
"c" 3} | |
"f" 6}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_currentDailyWeapon = _possibleWeapons[0]; | |
foreach( var weapon in _possibleWeapons) | |
{ | |
if(weapon.HardCurrencyCost.HasValue && _currentDailyWeapon.HardCurrencyCost.HasValue) | |
{ | |
if( weapon.HardCurrencyCost.Value < _currentDailyWeapon.HardCurrencyCost.Value) | |
_currentDailyWeapon = weapon; | |
} | |
else if(weapon.SoftCurrencyCost.HasValue && _currentDailyWeapon.SoftCurrencyCost.HasValue) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - wtf apple section | |
// instead of relying on SKPaymentTransactionState, use isTransactionRestore and isTransactionPurchase | |
- (BOOL)isTransactionRestore:(SKPaymentTransaction *)transaction { | |
BOOL purchasedButStillRestore = [self isPurchaseButStillRestoreTransaction:transaction]; | |
return (transaction.transactionState == SKPaymentTransactionStateRestored) || purchasedButStillRestore; | |
} | |
- (BOOL)isTransactionPurchase:(SKPaymentTransaction *)transaction { |