~ubuntu-branches/ubuntu/saucy/cuyo/saucy

« back to all changes in this revision

Viewing changes to data/rollenspiel.ml

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2010-07-19 09:54:44 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100719095444-ecoegzo1vvvdwra9
Tags: 2.~-1.1.brl3-1ubuntu1
* Merge from debian unstable (LP: #607106). Remaining changes:
  - Don't register MimeType=application/x-executable in
    the .desktop file.
  - Remove UTF-8 in the .desktop file
  - 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
   Copyright 2006 by Mark Weyer
 
3
 
 
4
   This program is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation; either version 2 of the License, or
 
7
   (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
   GNU General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License
 
15
   along with this program; if not, write to the Free Software
 
16
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
*)
 
18
 
 
19
open Farbe
 
20
open Graphik
 
21
open Vektorgraphik
 
22
 
 
23
open Male_mit_aa
 
24
 
 
25
 
 
26
let rand = 3.0/.64.0
 
27
let kantenrad = 1.0/.5.0
 
28
let punktd = 2.0/.9.0
 
29
let punktrad = 1.0/.15.0
 
30
let pi = 4.0*.(atan 1.0)
 
31
 
 
32
let rand' = rand+.kantenrad
 
33
let punktp = 0.5-.punktd
 
34
let punktp' = 0.5+.punktd
 
35
 
 
36
let grau = rgbrgb 0.9 0.9 1.0
 
37
let normal = rgbrgb 1.0 1.0 0.8
 
38
let gras = rgbrgb 1.0 0.9 0.9
 
39
 
 
40
let wuerfel farbe n =
 
41
  let punkte =
 
42
    (if n mod 2 = 1  then [0.5,0.5]  else []) @
 
43
    (if n >= 3  then [punktp,punktp; punktp',punktp']  else []) @
 
44
    (if n-2*(n mod 2) >= 2  then [punktp',punktp; punktp,punktp']  else []) @
 
45
    (if n >= 6  then [punktp,0.5; punktp',0.5]  else []) @
 
46
    (if n >= 8  then [0.5,punktp; 0.5,punktp']  else [])  in
 
47
  let punkte = konvertiere_polygon
 
48
    (List.map (fun p -> Kreis (p,punktrad)) punkte)  in
 
49
  let aussen = konvertiere_polygon
 
50
    [Strecke ((rand',rand),(1.0-.rand',rand));
 
51
    Bogen ((1.0-.rand',rand'),kantenrad,true,1.5*.pi,0.0);
 
52
    Strecke ((1.0-.rand,rand'),(1.0-.rand,1.0-.rand'));
 
53
    Bogen ((1.0-.rand',1.0-.rand'),kantenrad,true,0.0,0.5*.pi);
 
54
    Strecke ((1.0-.rand',1.0-.rand),(rand',1.0-.rand));
 
55
    Bogen ((rand',1.0-.rand'),kantenrad,true,0.5*.pi,pi);
 
56
    Strecke ((rand,1.0-.rand'),(rand,rand'));
 
57
    Bogen ((rand',rand'),kantenrad,true,pi,1.5*.pi);]  in
 
58
  male
 
59
    (erzeuge_vektorbild
 
60
      [Flaechen ([|von_rgb farbe; schwarz|], [aussen,0,None; punkte,1,Some 0]);
 
61
      Strich (schwarz, [aussen; punkte])])
 
62
    (1.0/.32.0)
 
63
    (monochrom durchsichtig 1 1)
 
64
 
 
65
let wuerfel = kombiniere_bildchen 2 4
 
66
  [(0,3,wuerfel grau 0);
 
67
  (1,3,wuerfel normal 1); (0,2,wuerfel normal 2); (1,2,wuerfel normal 3);
 
68
  (0,1,wuerfel normal 4); (1,1,wuerfel normal 5); (0,0,wuerfel normal 6);
 
69
  (1,0,wuerfel gras 9)]
 
70
 
 
71
 
 
72
 
 
73
;;
 
74
 
 
75
let gric = int_of_string Sys.argv.(1)  in
 
76
 
 
77
gib_xpm_aus (rgb_grau 1.0) "mrpAlle" (berechne gric wuerfel)
 
78