# include # include # include # include # include # include "cross_chaos.h" int main ( ); void timestamp ( ); /******************************************************************************/ int main ( ) /******************************************************************************/ /* Purpose: cross_chaos() uses an iterated function system to make a dot plot of a cross. Licensing: This code is distributed under the MIT license. Modified: 25 August 2025 Author: John Burkardt */ { int n; timestamp ( ); printf ( "\n" ); printf ( "cross_chaos_test():\n" ); printf ( " C version\n" ); printf ( " cross_chaos() uses an iterated map to plot a cross.\n" ); n = 5000; printf ( " Number of iterations = %d\n", n ); cross_chaos ( n ); /* Terminate. */ printf ( "\n" ); printf ( "cross_chaos_test():\n" ); printf ( " Normal end of execution.\n" ); timestamp ( ); return 0; } /******************************************************************************/ void timestamp ( ) /******************************************************************************/ /* Purpose: timestamp() prints the current YMDHMS date as a time stamp. Example: 17 June 2014 09:45:54 AM Licensing: This code is distributed under the MIT license. Modified: 01 May 2021 Author: John Burkardt */ { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; now = time ( NULL ); tm = localtime ( &now ); strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); printf ( "%s\n", time_buffer ); return; # undef TIME_SIZE }