コード例 #1
0
ファイル: Beers.cs プロジェクト: eirikb/extreme-sharepoint
        public Beers()
        {
            var count = new Random().Next(1, _beers.Keys.Count - 2);
            var keys  = _beers.Keys.ToList();

            keys     = Sorder.RandomPermutation(keys).ToList();
            keys     = keys.Take(count).ToList();
            Question = string.Format("Er alle disse norske bryggerier(ish)? {0}", string.Join(" ", keys.ToArray()));
            _all     = keys.All(key => _beers[key]);
        }
コード例 #2
0
        public Topper()
        {
            var maxTops = new Random().Next(1, _topps.Keys.Count);

            _tops    = _topps.Keys.ToList();
            _tops    = Sorder.RandomPermutation(_tops).ToList();
            _tops    = _tops.Take(maxTops).ToList();
            Question = string.Format("Sorter disse fjelltoppene i stigende rekkefølge: {0}",
                                     string.Join(" ", _tops.ToArray()));
            _tops.Sort((a, b) => _topps[a] - _topps[b]);
        }