User Tools

Site Tools


gamesspinner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gamesspinner [2016/01/01 22:37]
127.0.0.1 external edit
gamesspinner [2020/02/28 10:46]
Line 1: Line 1:
-{{gamesspinner.png?200}} 
-Spin a pointer to generate a random number.  Requires 0.9.9.26 or higher.\\ 
-<code> 
-# spinner.kbs - spin the wheel for a random number 
-# 2013-01-03 j.m.reneau 
-# requires 0.9.9.26 or higher 
- 
-clg 
-dim colors(1) 
-colors = {red, green, yellow, blue, cyan, purple} 
-fastgraphics 
-n = rand 
-segments = 10 # change for a different number of stops 
-slice = 2 * pi / segments 
-ha = 2*pi*(1+n) 
-n = int(n*segments+1) 
-for t = 0 to ha step pi/30 
-   clg 
-   a = 0 
-   for u = 0 to segments-1 
-      color black,colors[u%colors[?]] 
-      pie 0,0,300,300,a,slice 
-      a = a + slice 
-   next u 
-   color black 
-   call spinner(t) 
-   refresh 
-   pause .01 
-   if ha-t < 1 then pause .1 
-   if ha-t < .3 then pause .1 
-next t 
-color white 
-font "arial",100,100 
-text 110,70,n 
-refresh 
-print n 
-end 
- 
-subroutine spinner(a) 
-   stamp 150,150,3,a,{-2,2,-2,-40,-5,-40,0,-50,5,-40,2,-40,2,2} 
-end subroutine 
- 
-</code> 
  
gamesspinner.txt ยท Last modified: 2020/02/28 10:46 (external edit)