New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hanoi-tower-react

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hanoi-tower-react

Made with create-react-library

latest
npmnpm
Version
2.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

hanoi-tower-react

React, TypeScript, Bootstrap

version React

Install

npm install --save hanoi-tower-react

Usage

import React, { useState } from "react";
import HanoiTower from "hanoi-tower-react";
import { Card } from "react-bootstrap";
import Form from "react-bootstrap/Form";

const App = () => {
  const [level, setLevel] = useState(3);

  const levelOptions = [
    { name: "level 1", value: 1 },
    { name: "level 2", value: 2 },
    { name: "level 3", value: 3 },
    { name: "level 4", value: 4 },
    { name: "level 5", value: 5 },
    { name: "level 6", value: 6 },
    { name: "level 7", value: 7 }
  ];

  return (
    <Card>
      <Card.Header>Hanoi Tower</Card.Header>
      <Card.Body>
        <Form.Select onChange={(e) => {
          const val = e.target.options[e.target.selectedIndex].value;
          setLevel(parseInt(val));
        }} value={level}>
          {levelOptions.map((opt, index) => <option key={index} value={opt.value}>{opt.name}</option>)}
        </Form.Select>
        <HanoiTower level={level} />
      </Card.Body>
    </Card>
  );
};

export default App;

Example

image

조작법

  • 마우스 드래그앤 드랍
  • 키보드
    • 좌, 우 방향키
    • 스페이스 원판 선택 및 원판 드랍
    • 리셋: R
    • Auto Solve: A

Structure

  • index.tsx
    • main Component
  • helper.tsx
    • util&helper functions
  • components
    • child components
  • modules
    • module classes
  • types
    • interfaces

License

MIT ©

FAQs

Package last updated on 19 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts