root/native_client_sdk/src/examples/tutorial/dlopen/eightball.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. Magic8Ball

// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdlib.h>
#include <stdio.h>

#include "eightball.h"

extern "C" const char* Magic8Ball() {
  const int NSIDES = 8;
  const char* answer[NSIDES] = { "YES", "NO", "MAYBE", "MAYBE NOT",
                                 "DEFINITELY", "ASK ME TOMORROW",
                                 "PARTLY CLOUDY", "42", };
  return answer[rand() % NSIDES];
}

/* [<][>][^][v][top][bottom][index][help] */