2015-09-09 qiita> How to write code name (check with csharp)> csharp: Write testScript.cs instead of testScript.cs https://qiita.com/7of9/items/c3d413a41fd959bac69c#comment-345b621cad4d6db874fa
I will try various things.
For comparison, the citation source has not changed.
Program change (3) Endian confirmation program, 64bit added (C language). https://qiita.com/kaizen_nagoya/items/f55112ca74936fd30fcb
endian3.c
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
int main (int argc, char **argv)
{
union
{
uint64_t b8 ; // 8byte
uint32_t b4 [2] ; // 4byte x 2
uint16_t b2 [4] ; // 2byte × 4
uint8_t b1 [8] ; // 1byte × 8
} bytes ;
bytes.b8 = 0x123456789ABCDEF0 ;
printf ("bytes.b8: %16" PRIX64 "\n", bytes.b8);
printf ("bytes.b4: %08" PRIX32 ", %08" PRIX32 " \n", bytes.b4[0], bytes.b4[1]) ;
printf ("bytes.b2: %04" PRIX16 ", %04" PRIX16 ", %04" PRIX16 ", %04" PRIX16 " \n", bytes.b2[0], bytes.b2[1], bytes.b2[2], bytes.b2[3]) ;
printf ("bytes.b1: %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 ", %02" PRIX8 " \n", bytes.b1[0], bytes.b1[1], bytes.b1[2], bytes.b1[3], bytes.b1[4], bytes.b1[5], bytes.b1[6], bytes.b1[7]) ;
return 0 ;
}
python
Program change (1) I tried running "I want to win with Hyakunin Isshu with Python" with docker https://qiita.com/kaizen_nagoya/items/f8297f544fcbf4787f2a
hyaku_main.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import random
import pandas as pd
def load():
return pd.read_csv("Hyakunin Isshu.csv")
def loop(simo, kami):
while True:
k = 99 # 1~It's a number of 99. You can decide the range up to.
n = random.randint(0, k) #Decide the number to sing
i = 0
while True:
j = 1
simo_n = simo[n]
kami_n = kami[n]
print("【", j, "Question] The phrase below is", simo_n, "\n")
s = input()
if s == "end": #end is the end
break
if kami_n == s: #If the answer is correct, the next loop
print("Is the correct answer!\n")
break
else:
print("Incorrect ...\n")
print("rear", 1, "Give times chance")
if len(kami_n) != 0:
print("The first letter of the above phrase is", kami_n[0])
print(len(kami_n), "It is a character.")
else:
print("It is one character.\n")
s = input()
if s == "end":
break
if kami_n == s:
print("Is the correct answer")
print(simo_n, "The correct answer is", kami_n, "was.\n")
else:
print("Incorrect\n")
print(simo_n, "The correct answer is", kami_n, "was.\n")
break
j += 1
if s == "end":
break
def main():
df = load() #Data reading
kami = df["Up"]
simo = df["under"]
#Rule explanation
print("[Special training for chizuchizu]\n")
print("【rule】")
print("I will write the lower phrase (fixed character), so please answer the fixed character of the upper phrase.")
print("If you want to quit, say "end"!\n")
loop(simo, kami)
if __name__ == "__main__":
main() #Run
dockerfile
dockerfile does not display the file name if it is only dockerfile. dockerfile: Make it a dockerfile.
docker (11) docker file I made it https://qiita.com/kaizen_nagoya/items/5139c4e1eb8d86a8ed15
dockerfile
From ubunt
MAINTAINER @kaizen_nagoya
WORKDIR /root
ENV HOME /root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
git \
libssl-dev \
libbz2-dev \
libsqlite3-dev \
libreadline-dev \
zlib1g-dev \
libasound2-dev \
libxss1 \
libxtst6 \
gdebi
RUN wget -O vscode-amd64.deb https://go.microsoft.com/fwlink/?LinkID=760868
RUN yes | gdebi vscode-amd64.deb
RUN rm vscode-amd64.deb
RUN alias python='python3'
Recommended Posts