From owner-freebsd-hackers@freebsd.org Sun Oct 4 07:03:07 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A3213FCECF for ; Sun, 4 Oct 2020 07:03:07 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp13.smtpout.orange.fr [80.12.242.135]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C3vnk01Ddz4LX1 for ; Sun, 4 Oct 2020 07:03:05 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from garrigue.home ([90.112.35.12]) by mwinf5d73 with ME id bj33230030FipBu03j33vB; Sun, 04 Oct 2020 09:03:03 +0200 X-ME-Helo: garrigue.home X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Sun, 04 Oct 2020 09:03:03 +0200 X-ME-IP: 90.112.35.12 From: Paul Floyd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: Hi, I wrote a FOSS D&D dice rolling program Date: Sun, 4 Oct 2020 09:03:02 +0200 References: To: "freebsd-hackers@freebsd.org" In-Reply-To: Message-Id: <700AED36-5C96-46F1-8DD4-79005FA61001@wanadoo.fr> X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C3vnk01Ddz4LX1 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pjfloyd@wanadoo.fr has no SPF policy when checking 80.12.242.135) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [3.42 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[wanadoo.fr]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.12.242.135:from]; NEURAL_SPAM_SHORT(0.41)[0.411]; NEURAL_SPAM_MEDIUM(0.67)[0.672]; NEURAL_SPAM_LONG(0.94)[0.939]; RCVD_IN_DNSWL_NONE(0.00)[80.12.242.135:from]; TO_DN_EQ_ADDR_ALL(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[freebsd-hackers]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2020 07:03:07 -0000 > On 4 Oct 2020, at 00:19, Raj J Putari wrote: > typedef double long int64; Eh? Thankfully this doesn=E2=80=99t seem to be used. > struct Dice { > int Sides; > char description[700]; Doesn=E2=80=99t this overflow after say 50 rolls? > struct Dice Roll; > int rRandSeed; > time_t CurrentTime; =20 > Roll.Sides =3D Dice_Sides; > time(&CurrentTime); > rRandSeed =3D (int)rand() % Roll.Sides; So you get the time and then do nothing with it. I=E2=80=99d expect the = time to be used to seed the random number generation vi =E2=80=98srand()=E2=80=99= rand() isn=E2=80=99t the greatest of random number generators, but I suppose that it is OK for DND dice rolling. If you want people to use your code, it will need to be more complete and tested. A+ Paul=