Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MatrixCalculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maikov
MatrixCalculator
Commits
242afb2e
Commit
242afb2e
authored
1 month ago
by
T2heJada
Browse files
Options
Downloads
Patches
Plain Diff
Mõned veaparandused
parent
92ab8a06
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/ee/ut/cs/gitlab/maikov/Kasutajaliides.java
+20
-6
20 additions, 6 deletions
src/main/java/ee/ut/cs/gitlab/maikov/Kasutajaliides.java
src/main/java/ee/ut/cs/gitlab/maikov/expressions/Tehtepuu.java
+2
-2
2 additions, 2 deletions
...ain/java/ee/ut/cs/gitlab/maikov/expressions/Tehtepuu.java
with
22 additions
and
8 deletions
src/main/java/ee/ut/cs/gitlab/maikov/Kasutajaliides.java
+
20
−
6
View file @
242afb2e
...
...
@@ -429,18 +429,32 @@ public class Kasutajaliides {
}
private
void
tehted
()
{
String
sisend
=
prompt
(
"> Sisesta tehe"
+
System
.
lineSeparator
()
+
"| %LIST - Annab loetelu olemasolevates nimedest"
+
System
.
lineSeparator
()
+
"| %SET <nimi> <tehe> - Seab <nimi> väärtuseks <tehe> tulemuse"
);
String
sisend
=
prompt
(
"> Sisesta tehe"
+
System
.
lineSeparator
()
+
"| Maatrikseid saab luua kujul {{1,2},{3,4}}"
+
System
.
lineSeparator
()
+
"| Maatriksi transponeerimine: m^T"
+
System
.
lineSeparator
()
+
"| Maatriksi pöördmaatriks: m^-1"
+
System
.
lineSeparator
()
+
"| Astmesse tõstmist hetkel ei toetata"
+
System
.
lineSeparator
()
+
"| %LIST - Annab loetelu olemasolevates nimedest"
+
System
.
lineSeparator
()
+
"| %SET <nimi> <tehe> - Seab <nimi> väärtuseks <tehe> tulemuse"
);
String
[]
s
=
sisend
.
split
(
" "
);
String
tehe
=
s
[
0
].
toUpperCase
();
if
(
tehe
==
" "
)
{
if
(
tehe
.
trim
().
equals
(
""
)
)
{
// Ei tee midagi
}
else
if
(
tehe
.
equals
(
"%"
))
{
return
;
}
else
if
(
tehe
.
equals
(
"%SET"
))
{
// Sea väärtuseks
väärtusta
(
s
[
1
],
sisend
.
split
(
" "
,
3
)[
2
]);
System
.
out
.
println
(
1
);
if
(
s
.
length
>=
3
){
// On olemas nimi ja võrrand
väärtusta
(
s
[
1
],
sisend
.
split
(
" "
,
3
)[
2
]);
}
else
{
teade
(
next
,
"Puudub nimi või võrrand"
);
}
}
else
{
// Soorita tehe
System
.
out
.
println
(
String
.
valueOf
(
parse_wrap
(
sisend
)));
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/ee/ut/cs/gitlab/maikov/expressions/Tehtepuu.java
+
2
−
2
View file @
242afb2e
...
...
@@ -202,9 +202,9 @@ public class Tehtepuu {
&&
tehted
.
get
(
tehted
.
size
()
-
1
).
equals
(
"^"
))
{
vasak
.
add
(
new
Number
(-
2
));
// Sümboliseerib transp.
}
else
if
(
liikmed
.
containsKey
(
lekseem
))
{
vasak
.
add
(
liikmed
.
get
(
lekseem
));
vasak
.
add
(
liikmed
.
get
(
lekseem
)
.
clone
()
);
}
else
{
throw
new
TundmatuMuutuja
(
lekseem
);
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment