2008-02-16 02:46:37 +00:00
|
|
|
//
|
|
|
|
// Pair.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Eric Hanneken on 2/13/08.
|
|
|
|
// Copyright 2008 Vincent Spader. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
@interface NSArray (ShuffleUtils)
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)arrayWithRandomLongs:(NSUInteger)count;
|
2008-02-16 02:46:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* zip produces a new array by pairing successive objects
|
|
|
|
* from two input arrays until one is exhausted. Only
|
|
|
|
* pointers are copied; the objects are not.
|
|
|
|
*/
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)zipArray:(NSArray *)x withArray:(NSArray *)y;
|
2008-02-16 02:46:37 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Unzip produces a new pair of arrays by separating
|
|
|
|
* an input array of pairs. Only pointers are copied;
|
|
|
|
* the objects are not.
|
|
|
|
*/
|
2022-02-07 05:49:27 +00:00
|
|
|
+ (NSArray *)unzipArray:(NSArray *)pairs;
|
2008-02-16 02:46:37 +00:00
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
- (NSComparisonResult)compareFirsts:(id)y;
|
2008-02-16 02:46:37 +00:00
|
|
|
- (id)first;
|
|
|
|
- (id)second;
|
|
|
|
|
|
|
|
@end
|