About: Source:NetHack 1.3d/rnd.c   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Below is the full text to rnd.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/rnd.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code

AttributesValues
rdfs:label
  • Source:NetHack 1.3d/rnd.c
rdfs:comment
  • Below is the full text to rnd.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/rnd.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code
dcterms:subject
dbkwik:nethack/pro...iPageUsesTemplate
abstract
  • Below is the full text to rnd.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/rnd.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)rnd.c 1.3 87/07/14 2. /* rnd.c - version 1.0.2 */ 3. 4. #define RND(x) ((rand()>>3) % x) 5. 6. rn1(x,y) /* y <= rn1(x,y) < (y+x) */ 7. register x,y; 8. { 9. return(RND(x)+y); 10. } 11. 12. rn2(x) /* 0 <= rn2(x) < x */ 13. register x; 14. { 15. return(RND(x)); 16. } 17. 18. rnd(x) /* 1 <= rnd(x) <= x */ 19. register x; 20. { 21. return(RND(x)+1); 22. } 23. 24. d(n,x) /* n <= d(n,x) <= (n*x) */ 25. register n,x; 26. { 27. register tmp = n; 28. 29. while(n--) tmp += RND(x); 30. return(tmp); 31. }
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software