LoginSignup
4
4

More than 5 years have passed since last update.

*を使って次の図を書くプログラムを作成せよ。ただし、必ずfor文を使用すること

Last updated at Posted at 2014-02-27


**
***
****
***
**

っていうネタをTwitterで見かけたので、JavaScriptで140文字制限でやってみた。

!function(){e='',w=4,f=true,t='';for(i=1;i>0;(f)?i++:i--){c='';for(m=0;m<i;m++){c+=e}t+='<p>'+c+'</p>';if(i>=w)f=false}document.write(t)}()

もっと短くならないかな……?

4
4
10

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4