You're going to do my programming homework. Because want you to.
This is very simple... Work + No Spare Time = No Homework Done
So here's the deal: I supply to you my Java Homeworks and you'll do it.
If you're unable to do it, feel free to post whatever you like.
If you're a fucking coding god, you will post your ultimate solution, and face the criticism from other coding gods, including moot.
Cruel Leonidas demanded that you stand. I require only that you kneel.
Name:
Anonymous2007-04-09 13:27 ID:nDUlYiO3
This is madness. (Or Java, whichever word you prefer)
Besides, my dick is so long, I have a cramp in my upper leg. I can't kneel for you.
If you're eating dinner out, and not ordering pizza in, you'll never be a programmer. Sacrifice your social life now, or be condemned to a career filled with VB6 and legacy code.
Name:
Anonymous2007-04-09 18:47 ID:/1w4xrfa
I will do your programming homework.
I am a coding god.
It will be done.
Name:
Anonymous2007-04-09 19:41 ID:HpLdMw06
>>7
We have a programming class here that is mandatory to every course. I'm not going to be a programmer.
Name:
Anonymous2007-04-09 19:53 ID:N/BlYyRO
>>1
he didnt even post any homework
I was going to do it to troll people
-- You have to write a Java program that draws numbers in the computer screen, old calculator LED style. Counsider a screen with infinite lines and a max of 80 columns.
-- Input data:
The input file of this program contains several lines, one for each number being shown in the screen.
Each line has 2 integer numbers: S (where S is (1 <= S <= 10)) and N (where N is (0 <= N)). N is the number that will be written in the screen. S is the size of the characters.
-- Output data:
The screen prints (LED style ) the numbers in the file, using S symbols "-" for the horizontal segments and S "|" for the vertical segments. Each numerical digit ocupies exactly S+2 columns and 2S+3 lines.
The program must assure that all whitespaces of each numerical digit (the spaces that don't have "|" or "-"“, have the proper " " (space).
Between do consecutive numerical digits of a same number should exist a column of spaces. If there's 2 numbers in a row that are the same, they must be separeted with a space.
data Position = Left | Right | Both
data Digit = Digit Bool Position Bool Position Bool
digit :: Int -> Digit
digit 0 = Digit True Both False Both True
digit 1 = Digit False Right False Right False
digit 2 = Digit True Right True Left True
digit 3 = Digit True Right True Right True
digit 4 = Digit False Both True Right False
digit 5 = Digit True Left True Right True
digit 6 = Digit True Left True Both True
digit 7 = Digit True Right False Right False
digit 8 = Digit True Both True Both True
digit 9 = Digit True Both True Right True
horiz :: Int -> Bool -> [String]
horiz n False = [replicate n ' ']
horiz n True = [replicate n '-']
vert :: Int -> Position -> [String]
vert n pos = replicate n $ vert' n pos
vert' n Left = "|" ++ replicate (n-1) ' '
vert' n Right = replicate (n-1) ' ' ++ "|"
vert' n Both = "|" ++ replicate (n-2) ' ' ++ "|"
showDigit :: Int -> Digit -> [String]
showDigit n (Digit t u m l b) =
hor t ++ ver u ++ hor m ++ ver l ++ hor b
where hor = horiz n
ver = vert n
showDigits :: Int -> [Int] -> String
showDigits n = concat .
map ((++ "\n") . concat . intersperse " ") .
transpose . map (showDigit n . digit)
Run it with a filename as the command line argument. import java.io.*;
import java.util.*;
public class YourHomework {
private static final boolean flags[][]={
{true,true,true,false,true,true,true},
{false,false,true,false,false,true,false},
{true,false,true,true,true,false,true},
{true,false,true,true,false,true,true},
{false,true,true,true,false,true,false},
{true,true,false,true,false,true,true},
{true,true,false,true,true,true,true},
{true,false,true,false,false,true,false},
{true,true,true,true,true,true,true},
{true,true,true,true,false,true,true}
};
private static void printDigitLine(int n,int size,int line) {
char l=' ',c=' ',r=' ';
if (line==0) {
if (flags[n][0]) c='-';
} else if (line<=size) {
if (flags[n][1]) l='|';
if (flags[n][2]) r='|';
} else if (line==size+1) {
if (flags[n][3]) c='-';
} else if (line<=2*size+1) {
if (flags[n][4]) l='|';
if (flags[n][5]) r='|';
} else if (flags[n][6]) c='-';
System.out.print(l);
for (int i=0;i<size;i++) System.out.print(c);
System.out.print(r);
}
public static void main(String args[]) {
if (args.length==0) {
System.out.println("must be run with a filename argument");
return;
}
try {
BufferedReader in=new BufferedReader(new FileReader(args[0]));
String l;
StringTokenizer t;
int size;
String digits;
int maxperline;
int lines;
int bound;
while ((l=in.readLine())!=null) {
t=new StringTokenizer(l);
size=Integer.parseInt(t.nextToken());
digits=t.nextToken();
maxperline=81/(size+3);
lines=digits.length()/maxperline+1;
for (int i=0;i<lines;i++) {
for (int j=0;j<2*size+3;j++) {
bound=Math.min(digits.length(),(i+1)*maxperline);
for (int k=i*maxperline;k<bound;k++) {
printDigitLine(digits.charAt(k)-'0',size,j);
if (k<bound-1) System.out.print(' ');
}
System.out.print('\n');
}
System.out.print('\n');
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
I'm just saying this because I can't read what the fuck you just did.
This is more illegible than my children's "essays"...
Name:
Anonymous2007-04-11 13:22 ID:Jd8hd+qd
>>40
You use too much whitespace. You can eliminate all whitespace after the control keywords to save space. Also, I recommend dropping all indentation. You remember Java doesn't have forced indentation, thread over?
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy