Skip to content

A Go implementation of Andy Sloan's donut.c, showing a rotating toroid in the terminal rendered with characters

License

Notifications You must be signed in to change notification settings

GaryBoone/GoDonut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

donut.go is a Go implementation of Andy Sloan's donut.c.

It demonstrates:

  • 3d rendering in a terminal window with ascii characters
  • determining the terminal screen size
  • using a channel as a timer

Screenshot

	        @@@@@$$             
	      @@@$$#####$$          
	    $@$$$##*!*!**#$         
	   #$$$$#*!===!!!*##        
	   $$$$#*!=;:::;=!*##       
	  #$$$$#*=;~-,-~:=**##      
	  #$$$#**=:-  .-:=*###*     
	 *#$$$##!=~    .~=*##$#     
	 *#$$$##*=~     -;*#$$#=    
	 *######*!:     -=*#$$#!    
	 !*#####**=     ~!#$$$#*    
	 !*######**=    ;#$$$$#!    
	 =**#######*!  =#$@@@$#!    
	 =!**###########$@@@@$#!    
	 :!!**######$$$$$@@@$#*;    
	  =!!**#####$$$$$$$$$#!;    
	  :=!****####$$$$$$##*=     
	   :=!!!***########**=:     
	   -;;=!!!**********!;,     
	    ,:;==!!!*!!!!!!!;-      
	     ,~;;====!====;:-       
	       -~:;;;;;;:~~         
	         .---~~-,           

Usage

To run:

$ go run donut.go

Notes

The code was tested on Mac OSX Mountain Lion. The Go Syscall defines appear portable, but your milage may vary.

License

The code is available at github GaryBoone/GoDonut under MIT license.

About

A Go implementation of Andy Sloan's donut.c, showing a rotating toroid in the terminal rendered with characters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages