--- title: "Random ASCII Stereograms" type: "article" slug: "random-ascii-stereograms" url: "http://localhost/article/random-ascii-stereograms/" markdown_url: "http://localhost/article/random-ascii-stereograms.md" published_at: "2025-11-27T13:27:12+00:00" modified_at: "2026-06-21T23:24:03+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "In QHJ #9, Herb Schaaf wrote a program that created Random Dot Stereograms based on a Mathmatica program published in a Mathmatica magazine. A number of RDS's have been posted to alt.3d in postscript form. Herb and I have ruined our eyes looking at these things. All of the posted RDS's have a high dot…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "C (programming language)" slug: "c-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/c-programming-language/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors_r: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" issue: "11" issues_articles: - id: 61547 title: "QL Hacker’s Journal 11" type: "issue" url: "http://localhost/issue/ql-hackers-journal-11/" pubdate: "November 1992" archive_link: true --- # Random ASCII Stereograms In QHJ #9, [Herb Schaaf](http://localhost/indiv/herb-schaaf/) wrote a program that created [Random Dot Stereograms](http://localhost/article/random-dot-stereograms-2/) based on a Mathmatica program published in a Mathmatica magazine. A number of RDS’s have been posted to alt.3d in postscript form. Herb and I have ruined our eyes looking at these things. All of the posted RDS’s have a high dot resolution. Recently, David Coleman posted a different approach to these stereograms called Random ASCII Stereograms (RAS). His program takes an input file that describes the object to show in 3D, and produces an ASCII pattern, that when viewed correctly, shows the object in 3D. The stereograms are not as complicated as the RDS’s. They only show two levels of 3D, seen as a flat object above a flat surface. The RAS’s are not as interesting as RDS’s but are easily implemented on systems that may not display graphics, easy to port, and simpler to understand than RDS’s. Upon showing a associate at work, who has a big background in computer security, we wondered if text messages can be embedded into RDS’s and “invisible” to the average person. With RAS’s, this can easily be done. The input file can be a simple representation of characters and then easily e-mailed to others in “private”. Granted, not very private, but private unless you know the trick. The only changes I have made to Dave’s program are: 1. Use the proper Rand function for C68. 2. Send output to a file (flp1_ras_out) instead of stdout. ``` /* ras.c A simple random ascii stereogram generator 08/24/92 David Coleman, coleman@netmail.austin.ibm.com 10/05/92 Ported by QL by Tim Swenson added code to send output to flp1_ras_out instead of stdout. tswenson@se3c763a.pl.osd.mil */ #include #include #include main(argc,argv) int argc; char *argv[]; { int c,d,i,j,k,row,col,flag,done; char rstr[17]; char line[24][80]; FILE *fp, *fd2; flag = done = 0; if (2!=argc) { fprintf(stderr,"usage: %s datafile\n",argv[0]); exit(1); } srand(getpid()); for (i=0;i<20;i++) { for (j=1;j<16;j++) { done=0; while(0==done) { c = (43+rnd(79)); flag = 0; for (k=1;k