Skip to content

Commit

Permalink
add Spreeha as contributor (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spreeha authored and MadhavBahl committed Dec 26, 2018
1 parent 86b52e0 commit 55508d6
Show file tree
Hide file tree
Showing 9 changed files with 327 additions and 0 deletions.
1 change: 1 addition & 0 deletions day5/Java/dailycodebase
Submodule dailycodebase added at 86b52e
25 changes: 25 additions & 0 deletions day5/Java/pattern_1.java
@@ -0,0 +1,25 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern1 {
public static void main(String []args)
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.println();
}
}
}
27 changes: 27 additions & 0 deletions day5/Java/pattern_2.java
@@ -0,0 +1,27 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern2 {
public static void main(String []args)
{
int i,j;int k=1;
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(k);
k++;
}
System.out.println();
}
}

}
31 changes: 31 additions & 0 deletions day5/Java/pattern_3.java
@@ -0,0 +1,31 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern3 {
public static void main(String []args)
{
int i,j;int k=0;
int t=5/2;
t++;
for(i=1;i<=5;i++)
{
if(i<=t)
k++;
else
k--;
for(j=1;j<=k;j++)
{
System.out.print(j);
}
System.out.println();
}
}
}
44 changes: 44 additions & 0 deletions day5/Java/pattern_4.java
@@ -0,0 +1,44 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern4 {
public static void print(int s,int p)
{
int i,j;int t;
if(p<=5)
{
for(i=1;i<=s;i++)
System.out.print(' ');
t=p;
for(j=1;j<=p;j++)
{
System.out.print(t);
t++;
}
t-=2;
for(j=1;j<p;j++)
{
System.out.print(t);
t--;
}
System.out.println();
s--;
p++;
print(s,p);
}
else
return;
}
public static void main(String []args)
{
print(4,1);
}
}
30 changes: 30 additions & 0 deletions day5/Java/pattern_5.java
@@ -0,0 +1,30 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern5 {
public static void main(String []args)
{
int n=4;
int i,j;int k=0;int p=(n*2-1);
for(int t=1;t<=n;t++)
{
for(j=1;j<=k;j++)
System.out.print(' ');
k++;
for(i=1;i<=p;i++)
{
System.out.print('*');
}
p-=2;
System.out.println();
}
}
}
57 changes: 57 additions & 0 deletions day5/Java/pattern_6.java
@@ -0,0 +1,57 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern6 {
static int n=3;
public static void print(int k,int i)
{
int j;
for(j=1;j<=k;j++)
System.out.print(' ');
for(j=1;j<=i;j++)
System.out.print('*');
//System.out.println();
}
public static void printdown(int k,int i)
{
int j;
for(j=1;j<=k;j++)
System.out.print(' ');
for(j=1;j<=i;j++)
System.out.print('*');
//System.out.println();
}
public static void printrow(int i)
{
int k;int j;
k=n-i;
while(i<=n)
{
print(k,i);
k--;
i+=2;
System.out.println();
}
//k++;
while(i>=1)
{
printdown(k,i);
k++;
i-=2;
System.out.println();
}
}
public static void main(String []args)
{
printrow(1);
}

}
56 changes: 56 additions & 0 deletions day5/Java/pattern_7.java
@@ -0,0 +1,56 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern7 {
public static void main(String []args)
{
int n=3;
int i,j,t,k;int l=1;
t=n*2+1;
for(i=n;i>=1;i--)
{
k=t-2*i;
for(j=i;j>=1;j--)
{
System.out.print('*');
}
l=1;
while(l<=k)
{
System.out.print(' ');
l++;
}
//System.out.print(' ');
for(j=1;j<=i;j++)
System.out.print('*');
System.out.println();
}

for(i=1;i<=n;i++)
{
k=t-2*i;
for(j=i;j>=1;j--)
{
System.out.print('*');
}
l=1;
while(l<=k)
{
System.out.print(' ');
l++;
}
for(j=1;j<=i;j++)
System.out.print('*');
System.out.println();
}
}

}
56 changes: 56 additions & 0 deletions day5/Java/pattern_8.java
@@ -0,0 +1,56 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;

/**
*
* @author SPREEHA DUTTA
*/
public class pattern8 {
public static void main(String []args)
{
int n=3;
int i,j,t,k;int l=1;
t=n*2;
for(i=1;i<=n;i++)
{
k=t-2*i;
for(j=i;j>=1;j--)
{
System.out.print('*');
}
l=1;
while(l<=k)
{
System.out.print(' ');
l++;
}
for(j=1;j<=i;j++)
System.out.print('*');
System.out.println();
}

for(i=n;i>=1;i--)
{
k=t-2*i;
for(j=i;j>=1;j--)
{
System.out.print('*');
}
l=1;
while(l<=k)
{
System.out.print(' ');
l++;
}
//System.out.print(' ');
for(j=1;j<=i;j++)
System.out.print('*');
System.out.println();
}

}
}

0 comments on commit 55508d6

Please sign in to comment.