X-Git-Url: http://nitlanguage.org diff --git a/examples/draw_operation.nit b/examples/draw_operation.nit index cada831..a5ad1d5 100644 --- a/examples/draw_operation.nit +++ b/examples/draw_operation.nit @@ -17,14 +17,18 @@ # Draws an arithmetic operation to the terminal module draw_operation +`{ + #include +`} + redef enum Int fun n_chars: Int `{ int c; - if ( abs(recv) >= 10 ) - c = 1+(int)log10f( (float)abs(recv) ); + if ( abs(self) >= 10 ) + c = 1+(int)log10f( (float)abs(self) ); else c = 1; - if ( recv < 0 ) c ++; + if ( self < 0 ) c ++; return c; `} end