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
#mario.py
n=int(input('n: '))
for i in range(1,n+1):
    print(" "*(n - i),"#" * i)
anonymous No title
Python
#Grid.py
def main():
    num = int(input('How many grid? :'))
    print('-'*25)
    grid(num)

def grid(n):
    for i in range(n):
        print("#"*n)
    
main()
anonymous No title
Python
#GuessingGame.py
import random

Guess_num=random.randint(1,10)
i = 3
while i > 0:
    my_num=int(input("What's number? : "))
    if my_num > Guess_num:
        print('too big!')
        i -= 1
    elif my_num < Guess_num:
        print('too small!')
        i -= 1
    else:
        print('Congratuation!')
        break

if i:
    print(f'You Win. The number is {Guess_num}')
else:
    print(f'You Loose. The number is {Guess_num}')
anonymous GuessingGame.py
Python
#GuessingGame.py
import random

Guess_num=random.randint(1,10)
i = r = 3
while i > 0:
    my_num=int(input("What's number? : "))
    if my_num > Guess_num:
        print('too big!')
        i -= 1
    elif my_num < Guess_num:
        print('too small!')
        i -= 1
    else:
        print('Congratuation!')
        r = i =0

if not r :
    print(f'You Win. The number is {Guess_num}')
else:
    print(f'You Loose. The number is {Guess_num}')
anonymous Pythonで転置式暗号
Public Domain Python
#ENCRYPTING WITH THE TRANSPOSITION CIPHER

def main():
  myMessage = 'Common sense is not so common.'
  myKey = 8

  print(f'Key : {myKey}\nPlaneText : {myMessage}\nCipherText :{enc_box}')   

def encryptMessage(key, message):

  box=['']
  counter=0
  for i in message:
    box[counter] += i
    if len(box[counter]) == key:
      counter += 1
      box.append('')

  enc_box=''
  for i in range(myKey):
    for k in box:
      if i < len(k):
        enc_box += k[i]

    return enc_box

if __name__ == '__main__':
  main()
anonymous PythonでCaesar Cipher をbrute force
Public Domain Python
#HACKING THE CAESAR CIPHER WITH THE BRUTE-FORCE TECHNIQUE

alpha='abcdefghijklmnopqrstuvwxyz'.upper()
LETTER=''

Text='GUVF VF ZL FRPERG ZRFFNTR.'

for i, k in enumerate(alpha):
  shift=alpha.find(k)
  for j in Text:
    pos=alpha.find(j)
    if pos < 0:
      LETTER += j
    else:
      LETTER += (alpha*2)[pos+shift]
  print(f'Key#{str(i).zfill(2)} : {LETTER}')
  LETTER = ''
anonymous PythonでCaesar Cipher in Cryptography
Public Domain Python
#Caesar Cipher in Cryptography

def encrypt(text,s):
  alpha='abcdefghijklmnopqrstuvwxyz'
  cipher=(alpha*2)[s:s+26]
  output=''
  for i in text.lower():
    output +=cipher[alpha.find(i)] if i in alpha else i
  return output.upper()

def main():
  Text=input('Text :')
  Shift=int(input('Shift :'))
  
  print(f'Output : {encrypt(Text,Shift)}')

if __name__ == "__main__":
  main()
𝗜𝗭 Markdownのカレンダーテーブルを出力する 修正した
MIT Python
import datetime

# localeが動かなかったので削除

row_date = datetime.date.today()

print("|日付|予定|メモ|")
print("|:---:|:---|:---|")

for i in range(15):
  row = "| "
  row += str(row_date.strftime("%m/%d %a "))
  row += "| "
  if row_date.weekday() == 0: #月曜
    row += ""
  elif row_date.weekday() == 1: #火曜
    row += ""
  elif row_date.weekday() == 2: #水曜
    row += ""
  elif row_date.weekday() == 3: #木曜
    row += ""
  elif row_date.weekday() == 4: #金曜
    row += ""
  elif row_date.weekday() == 5: #土曜
    row += ""
  elif row_date.weekday() == 6: #日曜
    row += ""
  row += " |  |"
  print(row)
  row_date += datetime.timedelta(days=1)
𝗜𝗭 Markdownのカレンダーテーブルを出力する
MIT Python
import datetime, locale

locale.setlocale(locale.LC_TIME, 'ja_JP.UTF-8')
row_date = datetime.date.today()

print("|日付|予定|メモ|")
print("|:---:|:---|:---|")

for i in range(15):
  row = "| "
  row += str(row_date.strftime("%m/%d %a "))
  row += "| "
  if row_date.weekday() == 0: #月曜
    row += ""
  elif row_date.weekday() == 1: #火曜
    row += ""
  elif row_date.weekday() == 2: #水曜
    row += ""
  elif row_date.weekday() == 3: #木曜
    row += ""
  elif row_date.weekday() == 4: #金曜
    row += ""
  elif row_date.weekday() == 5: #土曜
    row += ""
  elif row_date.weekday() == 6: #日曜
    row += ""
  row += " |  |"
  print(row)
  row_date += datetime.timedelta(days=1)
anonymous No title
Python
print('Test')