Last active
December 19, 2015 21:39
-
-
Save Cycymomo/6021875 to your computer and use it in GitHub Desktop.
140bytes - drawCircleAsciiArt http://www.developpez.net/forums/d1362763/webmasters-developpement-web/javascript/ludique-defis-code-en-tweet/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 140bytes - http://www.developpez.net/forums/d1362763/webmasters-developpement-web/javascript/ludique-defis-code-en-tweet/ | |
(function cercle(r){ | |
a='';for(i=~r;i++<r;a+='\n')for(j=-r*2;j++<r*2;)a+=j*j/4<r*r-i*i?'#':' ';return a | |
})(20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* draw this : */ | |
" | |
######################### | |
################################### | |
########################################### | |
############################################### | |
##################################################### | |
######################################################### | |
############################################################# | |
############################################################### | |
################################################################### | |
##################################################################### | |
####################################################################### | |
######################################################################### | |
########################################################################### | |
############################################################################# | |
############################################################################# | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################### | |
############################################################################# | |
############################################################################# | |
########################################################################### | |
######################################################################### | |
####################################################################### | |
##################################################################### | |
################################################################### | |
############################################################### | |
############################################################# | |
######################################################### | |
##################################################### | |
############################################### | |
########################################### | |
################################### | |
######################### | |
" |
11 bytes off yours:
!function(r){for(a="",i=~r;i++<r;a+="\n")for(j=2*-r;j++<2*r;)a+=r*r-i*i>j*j/4?"#":" ";return a}(20)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used your function to make circle shape for happy face for http://www.whak.ca/packer/smilies.htm, thanks!