import React, { useState, Fragment } from 'react'
import MonacoEditor from '../components/monaco-editor'

const code1 = `
  #coding=utf-8
# 创建并读入range函数的相应参数
lower = int(input())
upper = int(input())
step = int(input()

# 请在此添加代码，实现编程要求
###### Begin ######
print('-------')

####### End #######`

const code2 = `
import java.util.Scanner;

public class Educode {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int nDisks = sc.nextInt();
        String from = sc.next();
        String inter = sc.next();
        String to = sc.next();
        doTowers(nDisks, from, inter, to);
    }
    
    // 实现汉诺塔算
    public static void doTowers(int topN, String from, String inter, String to) {
        
        
    }
}
`

export default () => {
  const [code, setCode] = useState(code2)
  const [language, setLanguage] = useState(['java'])
  return (
    <Fragment >
      <MonacoEditor width='100%' height='600' value={code} language={language} />
      <a onClick={() => { setCode(code1) }}>code1</a>
      <a onClick={() => { setLanguage(['ruby']) }}>lang ruby</a>
    </Fragment>

  )
}