diff --git a/equations/src/App.js b/equations/src/App.js index 1548996..1e986a2 100644 --- a/equations/src/App.js +++ b/equations/src/App.js @@ -107,7 +107,7 @@ function EquationValue(p) { function Equation(p) { const {data} = p - const [equation,setEquation]=useState([["data2"],"+","data3"]) + const [equation,setEquation]=useState([["atk"],"×","elementalBonus"]) function SolveEquation(eq) { var newEq = [...eq] @@ -170,22 +170,43 @@ function Equation(p) { {equation.map((eq,i)=>Array.isArray(eq)?:eq==="×"||eq==="-"||eq==="+"||eq==="÷"?:)}

-

{SolveEquation(equation)}

+

{SolveEquation(equation).toFixed(2)}

+ +} + +function EditBox(p) { + const {val,setVal} = p + + const [v,setV] = useState(val) + + useEffect(()=>{ + setVal(v) + },[v]) + + return {setV(ev.currentTarget.value)}}/> +} + +function ValueEditor(p) { + const {lv,setLv,atk,setAtk,def,setDef,elementalBonus,setElementalBonus} = p + + return <>LV
+ ATK
+ ENEMY DEF
+ ENEMY ELEMENTAL BONUS
} function App() { - const fieldData = { - data1:84, - data2:49, - data3:3.5, - data4:67 - } + const [lv,setLv] = useState(4) + const [atk,setAtk] = useState(84) + const [def,setDef] = useState(16) + const [elementalBonus,setElementalBonus] = useState(0.4) return (
+
- +
); }