SHARE
TWEET

r0cket / 29c3 moto

a guest Dec 28th, 2012 120 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top