출처 :
https://www.reddit.com/r/programminghorror/comments/cj8t99/format_your_code_well/
소스 코드 원문 :
https://github.com/XQ22/BadUI/blob/master/AngularPhoneNumber.pde
그리고 이 코드가 하는 짓 :
잘 안 보일 수도 있는데, 자세히 보면 선의 길이와 각도를 조절해서 전화번호를 입력하고 있습니다.
참고로, 위 소스 코드 원문 전체를 사람이 쉽게 읽을 수 있게끔 수정하면 다음과 같습니다. Processing이라는 언어인 모양인데, 저는 직접 안 써봐서 잘 모르겠네요.
float x1 = 320; float y1 = 240; float x2 = 320; float y2 = 120; int m, s, t, f = 0; int d = 180; float dd = 180.0; void setup() { size(640, 480); textAlign(CENTER); } void draw() { background(29, 39, 45); fill(67, 78, 89); text("Enter your phone number" + "using the two points:", 200, 50); text( "Angle: " + nf(d, 3) + "°" + nf(m, 2) + "′" + nf(s, 2) + "″" + nf(t, 2) + "′′′" + nf(f, 2) + "′′′′\nPhone number: (" + nf(d, 3) + ") " + nf(m, 2) + "" + nf(s, 2) + "-" + nf(t, 2) + "" + int(f / 10), 500, 300 ); fill(125, 89, 76); ellipse(x1, y1, 10, 10); line(x1, y1, x1 + 50, y1); fill(145, 109, 96); ellipse(x2, y2, 10, 10); line(x1, y1, x2, y2); if (dist(x2, y2, mouseX, mouseY) <= 20 && mousePressed) { x2 = mouseX; y2 = mouseY; } try { dd = degrees(atan((x2 - x1) / (y2 - y1)) + PI / 2); } catch (ArithmeticException e) { dd = 180.0; } d = int(dd); m = int((dd - d) * 60); s = int(((dd - d) * 60 - m) * 60); t = int((((dd - d) * 60 - m) * 60 - s) * 60); f = int(((((dd - d) * 60 - m) * 60 - s) * 60 - t) * 60); }