Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试生成随机日期,即当天后 10 到 30 天的任何一天,并且生成的日期不应该是周六和周日。我搜索了很多,但没有找到解决方案。
尝试:
repeat day <- pickRandomDay(10 ... 30) until (not satOrSun(day)) return day
您不会在循环中获得太多次。