Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences

anonymous No title
Python
import random

while True:
    print('Choice your hand, input number.')
    print('Rock    : 0')
    print('Paper   : 1')
    print('Scissors: 2')
    print('Exit    : 3')

    user_input = input()

    if not user_input.isdecimal():
        print('Invalid input')
    elif user_input == '3':
        break
    else:
        user_hand = int(user_input)
        ai_hand = random.randrange(3)

        if user_hand == 0:
            print('User hand: Rock')
        elif user_hand == 1:
            print('User hand: Paper')
        else:
            print('User hand: Scissors')

        if ai_hand == 0:
            print('AI hand  : Rock')
        elif ai_hand == 1:
            print('AI hand  : Paper')
        else:
            print('AI hand  : Scissors')

        if user_hand == (ai_hand + 1) % 3:
            print('Result   : Win')
        elif ai_hand == (user_hand + 1) % 3:
            print('Result   : Lose')
        else:
            print('Result   : Draw')

        print()
anonymous No title
Python
print('Hello World!!')
anonymous No title
C++
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(){ 
    lint N;
    cin >> N;
    vector<lint> A(N);
    rep( i, N ) cin >> A[i];

    vector<lint> ans(N);
    rep( i, N ) ans[0] = A[i] - ans[0];

    for( int i=1; i<N; ++i ) {
        ans[i] = 2 * A[i-1] - ans[i-1];
    }

    rep( i, N ) cout << ans[i] << endl;
}
anonymous No title
C++
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main(){ cin.tie(0); ios::sync_with_stdio(false);
    lint N = in; // < 10^5
    vector<lint> A(N);
    rep( i, N ) A[i] = in;


    vector<lint> ans(N);
    rep( i, N ) ans[0] = A[i] - ans[0];

    for( int i=1; i<N; ++i ) {
        ans[i] = 2 * A[i-1] - ans[i-1];
    }

    rep( i, N-1 ) cout << ans[i] << " ";
    cout << ans[N-1] << "\n";
}
anonymous No title
Brainfuck
>>>>>>>>>>
+++
>++<
[->>+<<<+>]<[->+<]>>[->+<<<+>>]<<[->>+<<]>
[->>>+<<<<+>]<[->+<]>>[->>-<<<<+>>]<<[->>+<<]>
[-<<+>+>]<[->+<]>[->[->>>+<<<<<+>>]<<[->>+<<]>]<<[->>+<+<]>[-<+>]>
>>++++++++++++++++++++++++++++++++++++++++++++++++.------------------------------------------------<<
<++++++++++.---------->
>>>++++++++++++++++++++++++++++++++++++++++++++++++.------------------------------------------------<<<
<++++++++++.---------->
>>>>++++++++++++++++++++++++++++++++++++++++++++++++.------------------------------------------------<<<<
<++++++++++.---------->
anonymous No title
Python
import pandas

def test(self):
    pass
anonymous No title
GPL v3 CoffeeScript
0
anonymous No title
HTML
<plaintext>
anonymous No title
Perl
print "hello\n"
anonymous No title
C++
#include <algorithm> // std::transform
#include <iostream>
#include <string>
#include <vector>

// 適当な文字列処理(とりあえず大文字にして返す)
std::string something(const std::string& s)
{
  std::string result;

  for (std::string::const_iterator iter {s.begin()}; iter != s.end(); ++iter)
  {
    result.push_back(std::toupper(*iter));
  }

  return result;
}

int main(void)
{
  std::vector<std::string> VNames = {"hoge", "fuga", "piyo"};

  struct SStore
  {
    std::string name;
    int something;
  };

  SStore stores[3];

  int i = 0;
  for (std::vector<std::string>::iterator iter = VNames.begin(); iter != VNames.end(); iter++)
  {
    // stores[i].name = *iter; //ここで文字コードの問題が発生したため、データを触りたくなった
    stores[i].name = something(*iter);
    ++i;
  }

  // std::cout << stores[2].name << std::endl;

  for (int i = 0; i < 3; ++i)
  {
    std::cout << "stores[" << i << "].name == " << stores[i].name << std::endl;
  }

  return 0;
}