You are currently browsing the tag archive for the ‘Goto Maki’ tag.

Just for fun, and because Goto Maki’s name makes a great programming pun, here’s a function in C/C++ that uses Goto’s name to actually do something (it computes the factorial of a number; the goto maki statement makes the program loop over the individual multiplications until the final product is computed):

int factorial(int n)
{
    int p = 1;
    maki:
    if (n == 0)
    {
        return p;
    }
    else
    {
        p *= n;
        n--;
        goto maki;
    }
}

You can put this in, say, a C++ program like the following:

gotomaki.cc

#include <iostream>;
using namespace std;

int factorial(int);

int main()
{
  int n;
  cout << "Enter a nonnegative integer to factorialize: ";
  cin >> n;
  cout << "The factorial of " << n << " is " << factorial(n) << ".\n" << endl;
  return 0;
}

int factorial(int n)
{
    int p = 1;
    maki:
    if (n == 0)
    {
        return p;
    }
    else
    {
        p *= n;
        n--;
        goto maki;
    }
}

and then you too (yes, you!) can factorialize away with Gocchin:

% g++ gotomaki.cc -o gotomaki
% ./gotomaki            
Enter a nonnegative integer to factorialize: 1
The factorial of 1 is 1.

% ./gotomaki
Enter a nonnegative integer to factorialize: 2
The factorial of 2 is 2.

% ./gotomaki
Enter a nonnegative integer to factorialize: 3
The factorial of 3 is 6.

% ./gotomaki
Enter a nonnegative integer to factorialize: 4
The factorial of 4 is 24.

% ./gotomaki
Enter a nonnegative integer to factorialize: 5
The factorial of 5 is 120.

% ./gotomaki
Enter a nonnegative integer to factorialize: 6
The factorial of 6 is 720.

% ./gotomaki
Enter a nonnegative integer to factorialize: 0
The factorial of 0 is 1.

Fun, ne?

Countdown! The Top 100 Hello! Project PVs

 

My last post has apparently sparked a “laugh riot” of a debate that’s now more than three times as long as my original post. If you haven’t seen it yet, you may find it worth reading. Or maybe not.

As always, I appreciate your feedback, positive or negative. It’s always good to know how effective my communication is.

And now, on to the next batch:

Read the rest of this entry »

Countdown! The Top 100 Hello! Project PVs

 

It has begun! :-) (see previous post for details)

But before it actually begins, I’m going to hand out some honorable mentions. In fact I’m going to hand out 20 honorable mentions. This is actually a shameless, thinly veiled excuse to produce a Top 120 countdown without bothering to rank or discuss the bottom 20. But still … these were the noteworthy videos that almost made the cut. And there were some pretty difficult decisions to make, so I feel they all deserve a mention.

Read the rest of this entry »

Welcome to yet another H!P-related blog. I’ve been lurking around the H!P blogosphere for the last couple of months and have finally decided to announce my existence, so here I am. Greetings. I am … uh … I have a couple of Internet handles but they date back to like high school and I need a new one. Let’s see… since this an H!P blog, and H!P is partly responsible for my coining a new word back in November or so, I’ll go with Kawaiirrhea. Here’s a definition:

kawaiirrhea (or kawaiirrhoea) [kʰəˌwaɪəˈɹiːə] n.
: an overwhelming feeling of being inundated with extreme cuteness, as often occurs in conjunction with experiencing the output of Hello! Project
(from Japanese kawaii ‘cute’ + Greek rhoia ‘flow’)

I’m a college student living in Cambridge, Massachusetts, USA, and taking probably too many courses, so I won’t be posting too frequently, except when I’m procrastinating, which happens frequently.

I will mainly be writing about topics related to Hello! Project and to a lesser extent, other elements of the J-Pop landscape. Also, since I’m something of a (multi-disciplinary) geek, you may find random unexpected intrusions from math, computer science, physics, linguistics, or literature (or other fields). Don’t worry; it makes sense … I think.

Read the rest of this entry »

Tweets from Kirarin☆Land

Remixes

DJ Kirarin☆Snow ☃'s remixes are now appearing at K!☆Mixed.
April 2014
S M T W T F S
« Feb    
 12345
6789101112
13141516171819
20212223242526
27282930  

Categories

Blog Stats

  • 66,201 hits
Follow

Get every new post delivered to your Inbox.