当天的游戏/行情-如何? [英] Game/Quote of the day - how to?

查看:45
本文介绍了当天的游戏/行情-如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有List<T>,其中包含游戏. 我想从该列表中选择1个游戏,这将是当天的游戏.

i have List<T> that contains games. i want to select 1 game from that list that will be the game of the day.

我不知道该怎么做.请贡献您的想法.

i have no idea on how i can do that. Please, contribute your ideas.

随机将不起作用,因为每个页面加载都会改变游戏. 游戏选择没有任何具体限制(票数,等级或其他). 至少应该是我所想的,所以应该与日期建立联系.

Random will not work, since every page load the game will change. There are no specific limits for the game selection ( votes,rating,whatever ). There should be a connection to the date due at least thats what i have in mind.

如果可以在当前日期之前选择一个随机游戏,那就是完美的解决方案.

if a random game could be select by the current date, thats the perfect solution.

推荐答案

var gameOfTheDay = games[(uint)(DateTime.Today.GetHashCode()) % games.Length];

这篇关于当天的游戏/行情-如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆