{"id":379,"date":"2010-11-25T23:36:58","date_gmt":"2010-11-25T22:36:58","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=379"},"modified":"2010-11-25T23:36:58","modified_gmt":"2010-11-25T22:36:58","slug":"mehr-ascii","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=379","title":{"rendered":"Mehr ASCII"},"content":{"rendered":"<p>Hier mal ein ASCII Strich ^^<br \/>\nMit GIF Anitmation damit man auch sieht was passsiert<\/p>\n<p><a href=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2010\/11\/pfeil.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2010\/11\/pfeil.gif\" alt=\"pfeil\" title=\"pfeil\" width=\"407\" height=\"403\" class=\"alignnone size-full wp-image-380\" srcset=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2010\/11\/pfeil.gif 407w, http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2010\/11\/pfeil-150x150.gif 150w, http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2010\/11\/pfeil-300x297.gif 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/a><\/p>\n<p>Und mein crazy Quellcode<\/p>\n<pre>\r\n#include < stdio.h >\r\n#include < math.h >\r\n#include < stdlib.h >\r\n#include < unistd.h >\r\n\r\nvoid gotoxy(int x,int y)\r\n{\r\n  printf(\"%c[%d;%df\",0x1B,y,x);\r\n}\r\n\r\nint main()\r\n{\r\n  \/\/ Start \/ End Position des Striches\r\n  float x1 = 0, x2 = 0, y1 = 0, y2 = 0;\r\n  \/\/ Laufvariable\r\n  int i = 0;\r\n  \/\/ Y Wert der Geraden Gleichgung\r\n  int y = 0;\r\n  \/\/ Steigung und F(x) Achsenabschnitt\r\n  float m = 0, b = 0;\r\n  \/\/ Winkel\r\n  float rad = 0;\r\n\r\n  while(1)\r\n  {\r\n    system(\"clear\");\r\n    \/\/ Neue x\/y Positionen berechnen\r\n    \/\/ Gerade hat einen Radius von 10 und ist um 25 in X und 15 in Y verschoben\r\n    x1 = cos(rad) * 10 + 25;\r\n    y1 = sin(rad) * 10 + 15;\r\n    x2 = cos(rad+3.1415) * 10 + 25;\r\n    y2 = sin(rad+3.1415) * 10 + 15;\r\n    \/\/ um 1\/16PI weiter drehen\r\n    rad += 3.1415\/16;\r\n    \/\/ Steigung berechnen\r\n    m = (y2-y1)\/(x2-x1);\r\n    \/\/ Achsenabschnitt berechnen\r\n    b = y1-m*x1;\r\n    \/\/ komische Schleife.\r\n    \/\/ X1 kann groessr als X2 sein, daher lass schleife so lange laufen\r\n    \/\/ bis x1 == x2 ist. Erhoehre oder erniedrige i je nachdem ob x1 groesser\r\n    \/\/ x2 ist oder umgekehrt\r\n    \/\/ Da nur ueber x Iteriert wird, ist bei einem senkrechten Strich nichts\r\n    \/\/ zu sehen. Wenn die Hoehe des Striches groesser als die Breite ist,\r\n    \/\/ sollte man ueber y Iterieren.\r\n    for(i = (int)x1; i != (int)x2; x1>x2?i--:i++)\r\n    {\r\n      \/\/ Gerade Zeichnen\r\n      y = m*i+b;\r\n      gotoxy(i, y);\r\n      printf(\"#\");\r\n    }\r\n    fflush(stdout);\r\n    sleep(1);\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hier mal ein ASCII Strich ^^ Mit GIF Anitmation damit man auch sieht was passsiert Und mein crazy Quellcode #include < stdio.h > #include < math.h > #include < stdlib.h > #include < unistd.h > void gotoxy(int x,int y) { printf(\"%c[%d;%df\",0x1B,y,x); } int main() { \/\/ Start \/ End Position des Striches float x1 = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=379"}],"version-history":[{"count":4,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":384,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions\/384"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}