Guest User

r0cket / 29c3 moto

a guest
Dec 28th, 2012
160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <sysinit.h>
  2. #include <string.h>
  3. #include "basic/basic.h"
  4. #include "lcd/render.h"
  5.  
  6. /*
  7.   Note: only works with name shorter than 8 characteres.
  8.   You just have to replace 'hybris' by your own nick.
  9.  */
  10.  
  11. char*   seps = "(.]/{-);[:}";
  12. char*   nick = "hybris";
  13.  
  14. void    generate(char*  str,
  15.          int    loop,
  16.          int    x,
  17.          int    y)
  18. {
  19.   int s = strlen(str);
  20.   char toPrint[2 * s + 1];
  21.  
  22.  
  23.   for (int i = 0; i < s; i++)
  24.     {
  25.       toPrint[i * 2] = str[i];
  26.       if (i != s - 1) {
  27.     toPrint[i * 2 + 1] = seps[(loop + i) % 11];}
  28.     }
  29.   toPrint[2 * s  - 1] = '\0';
  30.  
  31.   DoString(x, y, toPrint);
  32. }
  33.  
  34. void main_29c3(void)
  35. {
  36.   int i = 0;
  37.   int l = strlen(nick);
  38.  
  39.   if (l > 8) {
  40.     nick = "johndoe";
  41.     l = 7;}
  42.  
  43.   while (1) {
  44.     lcdFill(0);
  45.     generate(nick, i, 48 - 6 * l, 5);
  46.     generate("notmyd", i, 10, 25);
  47.     generate("epartme", i, 2, 40);
  48.     generate("nt29c3", i, 10, 55);
  49.     lcdDisplay();
  50.     delayms(1000);
  51.     i += 1;}
  52. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×