/usr/share/mozart/doc/demo/node21.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Two flowers: Flowers.oz</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="flowers.html">- Up -</A></TD><TD><A href="node22.html#code.flowers3d">Next >></A></TD></TR></TABLE><DIV class="unnumbered" id="code.flowers"><H3><A name="code.flowers">Two flowers: <CODE>Flowers.oz</CODE></A></H3><P class="margin"><A href="Flowers/Flowers.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN> <BR> <BR><SPAN class="keyword">import</SPAN> <BR> Tk<BR> Application<BR> <BR><SPAN class="keyword">define</SPAN> <BR> <BR> Width = 800<SPAN class="keyword">.</SPAN>0 Height = 700<SPAN class="keyword">.</SPAN>0<BR> <BR> FlowerA = flower(xPos : 200<SPAN class="keyword">.</SPAN>0<BR> yPos : 40<SPAN class="keyword">.</SPAN>0<BR> angle : 1<SPAN class="keyword">.</SPAN>570796327<BR> start : x<BR> grammar : grammar(x:[f [l x] f [r x] l x] f:[f f])<BR> delta : 0<SPAN class="keyword">.</SPAN>383972435<BR> stepWidth: 4<SPAN class="keyword">.</SPAN>0<BR> recDepth : 6)<BR> <BR> FlowerB = flower(xPos : 520<SPAN class="keyword">.</SPAN>0<BR> yPos : 115<SPAN class="keyword">.</SPAN>0<BR> angle : 1<SPAN class="keyword">.</SPAN>570796327<BR> start : f<BR> grammar : grammar(f:[f f r [r f l f l f] l [l f r f r f]])<BR> delta : 0<SPAN class="keyword">.</SPAN>383972435<BR> stepWidth: 10<SPAN class="keyword">.</SPAN>0<BR> recDepth : 4)<BR> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">TkFlowers</SPAN>}<BR> W = {New Tk<SPAN class="keyword">.</SPAN>toplevel tkInit(title: <SPAN class="string">'Flowers'</SPAN> <BR> delete: <SPAN class="keyword">proc</SPAN>{<SPAN class="functionname">$</SPAN>}<BR> {W tkClose}<BR> {Application<SPAN class="keyword">.</SPAN>exit 0}<BR> <SPAN class="keyword">end</SPAN>)}<BR> <BR> F = {New Tk<SPAN class="keyword">.</SPAN>frame tkInit(parent: W)}<BR> <BR> B1 = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:F action:DrawFlower<SPAN class="keyword">#</SPAN>FlowerA<BR> text:<SPAN class="string">'Start Flower A'</SPAN>)}<BR> B2 = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:F action:DrawFlower<SPAN class="keyword">#</SPAN>FlowerB<BR> text:<SPAN class="string">'Start Flower B'</SPAN>)}<BR> B3 = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:F action: <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN>}<BR> {DrawFlower FlowerA}<BR> {DrawFlower FlowerB}<BR> <SPAN class="keyword">end</SPAN> <BR> text:<SPAN class="string">'Start Both'</SPAN>)}<BR> B4 = {New Tk<SPAN class="keyword">.</SPAN>button tkInit(parent:F action: View<SPAN class="keyword">#</SPAN>tk(delete all)<BR> text:<SPAN class="string">'Clear'</SPAN>)}<BR> View = {New Tk<SPAN class="keyword">.</SPAN>canvas tkInit(parent:W width:Width height:Height)}<BR> <BR> {Tk<SPAN class="keyword">.</SPAN>batch [wm(minsize W 10 10)<BR> pack(B1 B2 B3 B4 side:left)<BR> pack(F View)]}<BR> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">DrawFlower</SPAN> flower(xPos:XPos yPos:YPos angle:Angle<BR> start:Start grammar:Grammar delta:Delta<BR> stepWidth:StepWidth recDepth: RecDepth)}<BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">DrawStep</SPAN> State}<BR> state(Xi Yi Z) = <SPAN class="keyword">!</SPAN>State<BR> Xo = Xi <SPAN class="keyword">+</SPAN> StepWidth <SPAN class="keyword">*</SPAN> {Cos Z}<BR> Yo = Yi <SPAN class="keyword">+</SPAN> StepWidth <SPAN class="keyword">*</SPAN> {Sin Z}<BR> <SPAN class="keyword">in</SPAN> <BR> {View tk(crea line Xi Height<SPAN class="keyword">-</SPAN>Yi Xo Height<SPAN class="keyword">-</SPAN>Yo)}<BR> state(Xo Yo Z)<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Draw</SPAN> N State ComList}<BR> state(X Y Z) = <SPAN class="keyword">!</SPAN>State<BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">if</SPAN> N <SPAN class="keyword">></SPAN> 0 <SPAN class="keyword">then</SPAN> <BR> <SPAN class="keyword">case</SPAN> ComList <SPAN class="keyword">of</SPAN> H<SPAN class="keyword">|</SPAN>T <SPAN class="keyword">then</SPAN> <BR> <SPAN class="keyword">case</SPAN> H<BR> <SPAN class="keyword">of</SPAN> l <SPAN class="keyword">then</SPAN> {Draw N state(X Y Z<SPAN class="keyword">+</SPAN>Delta) T}<BR> <SPAN class="keyword">[]</SPAN> r <SPAN class="keyword">then</SPAN> {Draw N state(X Y Z<SPAN class="keyword">-</SPAN>Delta) T}<BR> <SPAN class="keyword">[]</SPAN> _<SPAN class="keyword">|</SPAN>_ <SPAN class="keyword">then</SPAN> <BR> <SPAN class="keyword">thread</SPAN> {Draw N state(X Y Z) H _} <SPAN class="keyword">end</SPAN> <BR> {Draw N state(X Y Z) T}<BR> <SPAN class="keyword">else</SPAN> {Draw N {Draw N<SPAN class="keyword">-</SPAN>1 state(X Y Z) Grammar<SPAN class="keyword">.</SPAN>H} T} <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">else</SPAN> state(X Y Z) <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">else</SPAN> {DrawStep state(X Y Z)}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">thread</SPAN> <BR> {Draw RecDepth state(XPos YPos Angle) Grammar<SPAN class="keyword">.</SPAN>Start _}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> % <SPAN class="comment">proc DrawFlower<BR></SPAN> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">skip</SPAN> <BR> <SPAN class="keyword">end</SPAN> % <SPAN class="comment">proc TkFlowers<BR></SPAN> <BR> {TkFlowers}<BR> <BR><SPAN class="keyword">end</SPAN> <BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="flowers.html">- Up -</A></TD><TD><A href="node22.html#code.flowers3d">Next >></A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|