Modify a text file: $/factorial.java
$/factorial.java
//// CST 112 bam: Factorial demo int textX=10, textY=50, textD=15; void draw() { } void setup() { size(800, 600); background(255); fill(0); textline( "Factorial demo" ); textline( "" ); // Compute and display factorials from 1 to 20. for ( int j=1; j<20; j++) { int f= factorial( j ); textline( j+"! is "+f ); } } int factorial( int n ) { //// Compute the factorial of n; return n<2 ? 1 : n*factorial( n-1 ); } void textline( String s ) { //// Display another text line, beneath the last one. text( s, textX, textY ); textY += textD; }