<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dungeoncrawlchili.org/index.php?action=history&amp;feed=atom&amp;title=Random2</id>
	<title>Random2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dungeoncrawlchili.org/index.php?action=history&amp;feed=atom&amp;title=Random2"/>
	<link rel="alternate" type="text/html" href="https://wiki.dungeoncrawlchili.org/index.php?title=Random2&amp;action=history"/>
	<updated>2026-08-03T07:51:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.dungeoncrawlchili.org/index.php?title=Random2&amp;diff=4665&amp;oldid=prev</id>
		<title>Maintenance script: Importing CrawlWiki content</title>
		<link rel="alternate" type="text/html" href="https://wiki.dungeoncrawlchili.org/index.php?title=Random2&amp;diff=4665&amp;oldid=prev"/>
		<updated>2026-06-16T09:26:07Z</updated>

		<summary type="html">&lt;p&gt;Importing CrawlWiki content&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;random2&amp;#039;&amp;#039;&amp;#039; is a function used in Crawl&amp;#039;s code to select a random number. It is defined in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;random2(&amp;#039;&amp;#039;int max&amp;#039;&amp;#039;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and returns a random number from 0 to &amp;#039;&amp;#039;max-1&amp;#039;&amp;#039;, which is &amp;lt;code&amp;gt;1d&amp;#039;&amp;#039;max&amp;#039;&amp;#039; - 1&amp;lt;/code&amp;gt; in the dice notation. Therefore, &amp;#039;&amp;#039;&amp;#039;random2(2)&amp;#039;&amp;#039;&amp;#039; returns either 0 or 1, which is how the &amp;#039;&amp;#039;&amp;#039;coinflip&amp;#039;&amp;#039;&amp;#039; function is defined.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;random2&amp;#039;&amp;#039;&amp;#039; is defined in [https://github.com/crawl/crawl/blob/master/crawl-ref/source/random.cc random.cc], along with many other important random functions. Most calculations of damage, quantities, and properties, will use it, so wiki editors who are looking into the source to find out these values should familiarise themself with the function.&lt;br /&gt;
&lt;br /&gt;
[[Category:Source]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>