* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Useless s*** i wrote  (Read 157 times)

0 Members and 1 Guest are viewing this topic.

Offline gameblabla

  • Super User
  • Join Date: May 2015
  • Location:
  • Posts: 745
  • Post Rating Ratio: +15/-7
  • TI-nspire porter
Useless s*** i wrote
« on: October 06, 2017, 09:30:12 pm »
Post here your crappy code that either useless or very poor in quality.
Here's one, that calculates the time that takes for that mom to gain 70000000 kilos in milliseconds.

Code: [Select]
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <time.h>

int main(void)
{
    double yourmom = 0.0;
    double timetohold[2];
    double final_result = 0.0;
    struct timespec ts;
   
    timespec_get(&ts, TIME_UTC);
    timetohold[0] = ts.tv_nsec;
   
    while (yourmom < 70000000)
    {
    yourmom += 1.0;
    }

    timespec_get(&ts, TIME_UTC);
    timetohold[1] = ts.tv_nsec;
    final_result = timetohold[1] - timetohold[0];
    printf("Your mom gained 70000000 kilos in %f milliseconds\n", final_result / 1000000);
    return 0;
}


  • Calculators owned: TI Nspire CX, TI-89

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games